Page Speed Optimization Libraries
1.13.35.1
|
#include "named_lock_tester.h"
Public Member Functions | |
NamedLockTester (ThreadSystem *thread_system) | |
bool | TryLock (NamedLock *lock) |
bool | LockTimedWaitStealOld (int64 wait_ms, int64 steal_ms, NamedLock *lock) |
bool | LockTimedWait (int64 wait_ms, NamedLock *lock) |
bool | UnlockWithDelete (NamedLock *old_lock, NamedLock *new_lock) |
bool | StealWithDelete (int64 steal_ms, NamedLock *old_lock, NamedLock *new_lock) |
As for UnlockWithDelete, but for a steal. Frees both locks. More... | |
void | DeleteLock () |
void | Quiesce () |
void | set_quiesce (Function *quiesce) |
The NamedLock class does not have any blocking operations in it, as they don't fit well with PageSpeed's asynchronous archicture and with plans to make an asynchronous lock manager. However, in the context of unit tests, it is convenient to assume a blocking or schedule-based lock manager, and check that the call completes.
|
inline |
Sets a function to be called after calling an asynchronous locking method, prior to testing acuisition status. Onwership of this function transfers to this class.
|
inline |
As for UnlockWithDelete, but for a steal. Frees both locks.
wait_ms
|
inline |
Tests the specific case where the callback for new_lock deletes old_lock. The likely failure case is a SEGV, though you must verify a true return code or the test didn't run. Frees both locks.
wait_ms
< Long enough to ensure it doesn't timeout.