Changeset f6f7b52 for libcfa/src
- Timestamp:
- Jan 16, 2025, 1:27:27 PM (7 weeks ago)
- Branches:
- master
- Children:
- 9c65169
- Parents:
- 3b21c96
- git-author:
- kyoung <lseo@…> (01/15/25 22:56:36)
- git-committer:
- kyoung <lseo@…> (01/16/25 13:27:27)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified libcfa/src/concurrency/monitor.cfa ¶
r3b21c96 rf6f7b52 9 9 // Author : Thierry Delisle 10 10 // Created On : Thd Feb 23 12:27:26 2017 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Wed Nov 27 12:13:14 202413 // Update Count : 7 211 // Last Modified By : Kyoung Seo 12 // Last Modified On : Thd Jan 16 12:59:00 2025 13 // Update Count : 73 14 14 // 15 15 … … 922 922 static inline [thread$ *, int] search_entry_queue( const __waitfor_mask_t & mask, monitor$ * monitors [], __lock_size_t count ) { 923 923 __queue_t(thread$) & entry_queue = monitors[0]->entry_queue; 924 925 #if 0926 #if defined( __CFA_WITH_VERIFY__ )927 thread$ * last = 0p;928 #endif929 // For each thread in the entry-queue930 for ( thread$ ** thrd_it = &entry_queue.head; (*thrd_it) != 1p; thrd_it = &get_next(**thrd_it) ) {931 thread$ * curr = *thrd_it;932 933 /* paranoid */ verifyf( !last || last->user_link.next == curr, "search not making progress, from %p (%p) to %p",934 last, last->user_link.next, curr );935 /* paranoid */ verifyf( curr != last, "search not making progress, from %p to %p", last, curr );936 937 // For each acceptable check if it matches938 int i = 0;939 __acceptable_t * end = end(mask);940 __acceptable_t * begin = begin(mask);941 for ( __acceptable_t * it = begin; it != end; it++, i++ ) {942 // Check for match943 if ( *it == curr->monitors ) {944 // If match, return it after removeing it from the entry queue945 return [remove( entry_queue, thrd_it ), i];946 }947 }948 949 #if defined( __CFA_WITH_VERIFY__ )950 last = curr;951 #endif952 }953 #else954 924 // For each acceptable (respect lexical priority in waitfor statement) 955 __acceptable_t * it = end(mask); it--; // end is passed the last node, so backup 956 for ( int i = mask.size - 1; i >= 0; i -= 1, it-- ) { 925 int i = 0; 926 __acceptable_t * end = end(mask); 927 __acceptable_t * begin = begin(mask); 928 for ( __acceptable_t * it = begin; it != end; it++, i++ ) { 957 929 #if defined( __CFA_WITH_VERIFY__ ) 958 930 thread$ * last = 0p; … … 977 949 } // for 978 950 } // for 979 #endif980 951 return [0, -1]; 981 952 }
Note: See TracChangeset
for help on using the changeset viewer.