File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -20,19 +20,20 @@ To acquire a lock:
20
20
CLock my_lock;
21
21
bool flag = dlm->Lock("my_resource_name", 1000, my_lock);
22
22
or(will alway hold the lock until release it):
23
+
23
24
CLock my_lock;
24
25
bool flag = dlm->ContinueLock("my_resource_name", 1000, my_lock);
25
26
26
27
Where 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.
27
28
28
29
The 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:
29
30
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
+ };
36
37
37
38
validity, an integer representing the number of milliseconds the lock will be valid.
38
39
resource, the name of the locked resource as specified by the user.
You can’t perform that action at this time.
0 commit comments