Changeset 9f5a71eb
- Timestamp:
- Mar 2, 2022, 4:27:39 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- 496f92ed
- Parents:
- 1860885
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/io.cfa
r1860885 r9f5a71eb 408 408 // I/O Arbiter 409 409 //============================================================================================= 410 static inline void block(__outstanding_io_queue & queue, __outstanding_io & item) { 410 static inline bool enqueue(__outstanding_io_queue & queue, __outstanding_io & item) { 411 bool was_empty; 412 411 413 // Lock the list, it's not thread safe 412 414 lock( queue.lock __cfaabi_dbg_ctx2 ); 413 415 { 416 was_empty = empty(queue.queue); 417 414 418 // Add our request to the list 415 419 add( queue.queue, item ); … … 420 424 unlock( queue.lock ); 421 425 422 wait( item.sem );426 return was_empty; 423 427 } 424 428 … … 438 442 pa.want = want; 439 443 440 block(this.pending, (__outstanding_io&)pa); 444 enqueue(this.pending, (__outstanding_io&)pa); 445 446 wait( pa.sem ); 441 447 442 448 return pa.ctx; … … 491 497 ei.lazy = lazy; 492 498 493 block(ctx->ext_sq, (__outstanding_io&)ei); 499 bool we = enqueue(ctx->ext_sq, (__outstanding_io&)ei); 500 501 ctx->proc->io.pending = true; 502 503 if( we ) { 504 sigval_t value = { PREEMPT_IO }; 505 pthread_sigqueue(ctx->proc->kernel_thread, SIGUSR1, value); 506 } 507 508 wait( ei.sem ); 494 509 495 510 __cfadbg_print_safe(io, "Kernel I/O : %u submitted from arbiter\n", have);
Note: See TracChangeset
for help on using the changeset viewer.