- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/coroutine.c
rc40e7c5 rb69ea6b 10 10 // Created On : Mon Nov 28 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 21 22:34:57 201713 // Update Count : 112 // Last Modified On : Thu Feb 8 16:10:31 2018 13 // Update Count : 4 14 14 // 15 15 … … 77 77 __cfaabi_dbg_debug_do( 78 78 if ( mprotect( this.storage, pageSize, PROT_READ | PROT_WRITE ) == -1 ) { 79 abort f( "(coStack_t *)%p.^?{}() : internal error, mprotect failure, error(%d) %s.", &this, errno, strerror( errno ) );79 abort( "(coStack_t *)%p.^?{}() : internal error, mprotect failure, error(%d) %s.", &this, errno, strerror( errno ) ); 80 80 } 81 81 ); … … 99 99 // Wrapper for co 100 100 void CoroutineCtxSwitch(coroutine_desc* src, coroutine_desc* dst) { 101 // THREAD_GETMEM( This )->disableInterrupts(); 101 verify( preemption.enabled || this_processor->do_terminate ); 102 disable_interrupts(); 102 103 103 104 // set state of current coroutine to inactive … … 115 116 src->state = Active; 116 117 117 // THREAD_GETMEM( This )->enableInterrupts(); 118 enable_interrupts( __cfaabi_dbg_ctx ); 119 verify( preemption.enabled || this_processor->do_terminate ); 118 120 } //ctxSwitchDirect 119 121 … … 135 137 __cfaabi_dbg_debug_do( 136 138 if ( mprotect( storage, pageSize, PROT_NONE ) == -1 ) { 137 abort f( "(uMachContext &)%p.createContext() : internal error, mprotect failure, error(%d) %s.", this, (int)errno, strerror( (int)errno ) );139 abort( "(uMachContext &)%p.createContext() : internal error, mprotect failure, error(%d) %s.", this, (int)errno, strerror( (int)errno ) ); 138 140 } // if 139 141 ); 140 142 141 143 if ( (intptr_t)storage == 0 ) { 142 abort f( "Attempt to allocate %d bytes of storage for coroutine or task execution-state but insufficient memory available.", size );144 abort( "Attempt to allocate %zd bytes of storage for coroutine or task execution-state but insufficient memory available.", size ); 143 145 } // if 144 146
Note:
See TracChangeset
for help on using the changeset viewer.