Changeset 38e3427 in mainline
- Timestamp:
- 2018-06-25T21:51:37Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f6372be9
- Parents:
- 95838f1
- git-author:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-06-25 21:03:47)
- git-committer:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-06-25 21:51:37)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/rcu.c
r95838f1 r38e3427 172 172 assert(!fibril_rcu.registered); 173 173 174 futex_ down(&rcu.list_futex);174 futex_lock(&rcu.list_futex); 175 175 list_append(&fibril_rcu.link, &rcu.fibrils_list); 176 futex_u p(&rcu.list_futex);176 futex_unlock(&rcu.list_futex); 177 177 178 178 fibril_rcu.registered = true; … … 197 197 fibril_rcu.nesting_cnt = 0; 198 198 199 futex_ down(&rcu.list_futex);199 futex_lock(&rcu.list_futex); 200 200 list_remove(&fibril_rcu.link); 201 futex_u p(&rcu.list_futex);201 futex_unlock(&rcu.list_futex); 202 202 203 203 fibril_rcu.registered = false; … … 334 334 static void wait_for_readers(size_t reader_group) 335 335 { 336 futex_ down(&rcu.list_futex);336 futex_lock(&rcu.list_futex); 337 337 338 338 list_t quiescent_fibrils; … … 345 345 346 346 if (is_preexisting_reader(fib, reader_group)) { 347 futex_u p(&rcu.list_futex);347 futex_unlock(&rcu.list_futex); 348 348 sync_sleep(); 349 futex_ down(&rcu.list_futex);349 futex_lock(&rcu.list_futex); 350 350 /* Break to while loop. */ 351 351 break; … … 358 358 359 359 list_concat(&rcu.fibrils_list, &quiescent_fibrils); 360 futex_u p(&rcu.list_futex);360 futex_unlock(&rcu.list_futex); 361 361 } 362 362 363 363 static void lock_sync(void) 364 364 { 365 futex_ down(&rcu.sync_lock.futex);365 futex_lock(&rcu.sync_lock.futex); 366 366 if (rcu.sync_lock.locked) { 367 367 blocked_fibril_t blocked_fib; … … 372 372 do { 373 373 blocked_fib.is_ready = false; 374 futex_u p(&rcu.sync_lock.futex);374 futex_unlock(&rcu.sync_lock.futex); 375 375 fibril_switch(FIBRIL_TO_MANAGER); 376 futex_ down(&rcu.sync_lock.futex);376 futex_lock(&rcu.sync_lock.futex); 377 377 } while (rcu.sync_lock.locked); 378 378 … … 394 394 if (0 < rcu.sync_lock.blocked_thread_cnt) { 395 395 --rcu.sync_lock.blocked_thread_cnt; 396 futex_u p(&rcu.sync_lock.futex_blocking_threads);396 futex_unlock(&rcu.sync_lock.futex_blocking_threads); 397 397 } else { 398 398 /* Unlock but wake up any fibrils waiting for the lock. */ … … 409 409 410 410 rcu.sync_lock.locked = false; 411 futex_u p(&rcu.sync_lock.futex);411 futex_unlock(&rcu.sync_lock.futex); 412 412 } 413 413 } … … 420 420 * but keep sync locked. 421 421 */ 422 futex_u p(&rcu.sync_lock.futex);422 futex_unlock(&rcu.sync_lock.futex); 423 423 async_usleep(RCU_SLEEP_MS * 1000); 424 futex_ down(&rcu.sync_lock.futex);424 futex_lock(&rcu.sync_lock.futex); 425 425 } 426 426
Note:
See TracChangeset
for help on using the changeset viewer.