Changeset a9ce782 for libcfa/src/concurrency/invoke.h
- Timestamp:
- Feb 7, 2026, 1:40:26 PM (26 hours ago)
- Branches:
- stuck-waitfor-destruct
- Parents:
- c7d106a
- git-author:
- Matthew Au-Yeung <mw2auyeu@…> (02/07/26 13:40:05)
- git-committer:
- Matthew Au-Yeung <mw2auyeu@…> (02/07/26 13:40:26)
- File:
-
- 1 edited
-
libcfa/src/concurrency/invoke.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/invoke.h
rc7d106a ra9ce782 159 159 // last function that acquired monitors 160 160 fptr_t func; 161 162 // hash-based function identity for cross-TU matching 163 func_id_t func_id; 161 164 }; 162 165 … … 288 291 (this.size){0}; 289 292 (this.func){NULL}; 290 } 291 292 static inline void ?{}(__monitor_group_t & this, struct monitor$ ** data, __lock_size_t size, fptr_t func) { 293 (this.func_id){0}; 294 } 295 296 static inline void ?{}(__monitor_group_t & this, struct monitor$ ** data, __lock_size_t size, fptr_t func, func_id_t func_id) { 293 297 (this.data){data}; 294 298 (this.size){size}; 295 299 (this.func){func}; 300 (this.func_id){func_id}; 296 301 } 297 302 … … 299 304 if( (lhs.data != 0) != (rhs.data != 0) ) return false; 300 305 if( lhs.size != rhs.size ) return false; 301 if( lhs.func != rhs.func ) return false; 306 // Use hash-based comparison when both sides have a valid func_id, 307 // otherwise fall back to function pointer comparison (for library code 308 // like join() that cannot compute the hash at compile time). 309 if( lhs.func_id != 0 && rhs.func_id != 0 ) { 310 if( lhs.func_id != rhs.func_id ) return false; 311 } else { 312 if( lhs.func != rhs.func ) return false; 313 } 302 314 303 315 // Check that all the monitors match … … 314 326 lhs.size = rhs.size; 315 327 lhs.func = rhs.func; 328 lhs.func_id = rhs.func_id; 316 329 } 317 330 }
Note:
See TracChangeset
for help on using the changeset viewer.