File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,19 +20,20 @@ To acquire a lock:
2020 CLock my_lock;
2121 bool flag = dlm->Lock("my_resource_name", 1000, my_lock);
2222or(will alway hold the lock until release it):
23+
2324 CLock my_lock;
2425 bool flag = dlm->ContinueLock("my_resource_name", 1000, my_lock);
2526
2627Where the resource name is an unique identifier of what you are trying to lock and 1000 is the number of milliseconds for the validity time.
2728
2829The returned value is false if the lock was not acquired (you may try again), otherwise an class representing the lock is returned, having three keys:
2930
30- class CLock {
31- public:
32- int m_validityTime; => 9897.3020019531 // 当前锁可以存活的时间, 毫秒
33- sds m_resource; => my_resource_name // 要锁住的资源名称
34- sds m_val; => 53771bfa1e775 // 锁住资源的进程随机名字
35- };
31+ class CLock {
32+ public:
33+ int m_validityTime; => 9897.3020019531 // 当前锁可以存活的时间, 毫秒
34+ sds m_resource; => my_resource_name // 要锁住的资源名称
35+ sds m_val; => 53771bfa1e775 // 锁住资源的进程随机名字
36+ };
3637
3738validity, an integer representing the number of milliseconds the lock will be valid.
3839resource, the name of the locked resource as specified by the user.
You can’t perform that action at this time.
0 commit comments