Ignore:
Timestamp:
May 4, 2020, 12:54:56 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
3c039b0
Parents:
c5c743e
Message:

Tentative fix to the deadlock in cluster shutdown

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/io.cfa

    rc5c743e r6502a2b  
    8989                void ?{}( __io_poller_fast & this, struct cluster & cltr ) {
    9090                        this.ring = &cltr.io;
     91                        this.waiting = true;
    9192                        (this.thrd){ "Fast I/O Poller", cltr };
    9293                }
     
    242243
    243244                #if defined(__CFA_IO_POLLING_USER__)
     245                        verify( this.io.poller.fast.waiting );
     246                        verify( this.io.poller.fast.thrd.state == Blocked );
     247
     248                        this.io.poller.fast.thrd.curr_cluster = mainCluster;
     249
    244250                        // unpark the fast io_poller
    245251                        unpark( &this.io.poller.fast.thrd __cfaabi_dbg_ctx2 );
     
    409415                        while(!__atomic_load_n(&this.ring->done, __ATOMIC_SEQ_CST)) {
    410416                                // Drain the io
    411                                 if(0 > __drain_io( *this.ring, 0p, 0, false )) {
     417                                this.waiting = false;
     418                                int ret = __drain_io( *this.ring, 0p, 0, false );
     419                                this.waiting = true;
     420                                if(0 > ret) {
    412421                                        // If we got something, just yield and check again
    413422                                        yield();
Note: See TracChangeset for help on using the changeset viewer.