I am working on multi-threaded code. Access to data is blocked in several sections through NSLock objects. I want to make sure that some of the methods that are called in these sections check to see if their corresponding lock was received.
Sort of:
assert([myLock isSet] == YES);
I can not find something like "isSet" in NSLock. Any ideas on how to secure the lock are set?
Thank!
? lock, , , , . lockBeforeDate, .
lock
lockBeforeDate
,
if ( [myLock tryLock] ) { // oops, lock was not previously acquired! ... [myLock unlock]; } else { // yep, lock was already acquired }
, , , . , , , .
.
, , , , , () , . :
:
, , .
, .
Source: https://habr.com/ru/post/1761314/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1761309/better-way-than-this-to-rename-files-using-python&usg=ALkJrhgxhBUL4iUHIvuoQkvDpoDFPpZGywRunning a Python script in a thread and redirecting std.out / std.err to wx.TextCtrl in the GUI - redirectOrder by articles in another table - sqlСвязанные списки: вставка в конце с использованием последнего указателя - cDoes onClick affect SEO value? - htmlWhat is the best layout for updating content without updating the entire page on an ASP.NET web page? - web-applicationsproblem with static variable - c #Sonar Source Analysis - sonarqubeHow to vectorize this operation for each row of the matrix - rHow does verbose forms debugging allow classes in eclipse? - javaAll Articles