- File:
-
- 1 edited
-
libcfa/src/concurrency/monitor.cfa (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/monitor.cfa
rbe5f0a5 rc18bf9e 122 122 123 123 // Some one else has the monitor, wait in line for it 124 /* paranoid */ verify( thrd-> user_link.next == 0p );124 /* paranoid */ verify( thrd->link.next == 0p ); 125 125 append( this->entry_queue, thrd ); 126 /* paranoid */ verify( thrd-> user_link.next == 1p );126 /* paranoid */ verify( thrd->link.next == 1p ); 127 127 128 128 unlock( this->lock ); … … 233 233 234 234 // Some one else has the monitor, wait in line for it 235 /* paranoid */ verify( thrd-> user_link.next == 0p );235 /* paranoid */ verify( thrd->link.next == 0p ); 236 236 append( this->entry_queue, thrd ); 237 /* paranoid */ verify( thrd-> user_link.next == 1p );237 /* paranoid */ verify( thrd->link.next == 1p ); 238 238 unlock( this->lock ); 239 239 … … 791 791 thread$ * new_owner = pop_head( this->entry_queue ); 792 792 /* paranoid */ verifyf( !this->owner || active_thread() == this->owner, "Expected owner to be %p, got %p (r: %i, m: %p)", active_thread(), this->owner, this->recursion, this ); 793 /* paranoid */ verify( !new_owner || new_owner-> user_link.next == 0p );793 /* paranoid */ verify( !new_owner || new_owner->link.next == 0p ); 794 794 __set_owner( this, new_owner ); 795 795 … … 935 935 __queue_t(thread$) & entry_queue = monitors[0]->entry_queue; 936 936 937 #if defined( __CFA_WITH_VERIFY__ )938 thread$ * last = 0p;939 #endif940 937 // For each thread in the entry-queue 941 938 for( thread$ ** thrd_it = &entry_queue.head; 942 939 (*thrd_it) != 1p; 943 thrd_it = & get_next(**thrd_it)940 thrd_it = &(*thrd_it)->link.next 944 941 ) { 945 thread$ * curr = *thrd_it;946 947 /* paranoid */ verifyf( !last || last->user_link.next == curr, "search not making progress, from %p (%p) to %p", last, last->user_link.next, curr );948 /* paranoid */ verifyf( curr != last, "search not making progress, from %p to %p", last, curr );949 950 942 // For each acceptable check if it matches 951 943 int i = 0; … … 954 946 for( __acceptable_t * it = begin; it != end; it++, i++ ) { 955 947 // Check if we have a match 956 if( *it == curr->monitors ) {948 if( *it == (*thrd_it)->monitors ) { 957 949 958 950 // If we have a match return it … … 961 953 } 962 954 } 963 964 #if defined( __CFA_WITH_VERIFY__ )965 last = curr;966 #endif967 955 } 968 956 … … 1037 1025 1038 1026 // Some one else has the monitor, wait in line for it 1039 /* paranoid */ verify( thrd-> user_link.next == 0p );1027 /* paranoid */ verify( thrd->link.next == 0p ); 1040 1028 append( this->entry_queue, thrd ); 1041 /* paranoid */ verify( thrd-> user_link.next == 1p );1029 /* paranoid */ verify( thrd->link.next == 1p ); 1042 1030 1043 1031 unlock( this->lock );
Note:
See TracChangeset
for help on using the changeset viewer.