Changeset 3d5701e for libcfa/src/concurrency/kernel_private.hfa
- Timestamp:
- Feb 25, 2020, 1:17:33 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 7dc2e015
- Parents:
- 9fb8f01 (diff), dd9e1ca (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
libcfa/src/concurrency/kernel_private.hfa (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel_private.hfa
r9fb8f01 r3d5701e 10 10 // Created On : Mon Feb 13 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 29 14:06:40 201813 // Update Count : 312 // Last Modified On : Sat Nov 30 19:25:02 2019 13 // Update Count : 8 14 14 // 15 15 … … 31 31 } 32 32 33 void ScheduleThread( thread_desc * ); 34 static inline void WakeThread( thread_desc * thrd ) { 35 if( !thrd ) return; 36 37 disable_interrupts(); 38 ScheduleThread( thrd ); 39 enable_interrupts( __cfaabi_dbg_ctx ); 40 } 41 thread_desc * nextThread(cluster * this); 33 void __schedule_thread( $thread * ) __attribute__((nonnull (1))); 42 34 43 35 //Block current thread and release/wake-up the following resources 44 void BlockInternal(void); 45 void BlockInternal(__spinlock_t * lock); 46 void BlockInternal(thread_desc * thrd); 47 void BlockInternal(__spinlock_t * lock, thread_desc * thrd); 48 void BlockInternal(__spinlock_t * locks [], unsigned short count); 49 void BlockInternal(__spinlock_t * locks [], unsigned short count, thread_desc * thrds [], unsigned short thrd_count); 50 void BlockInternal(__finish_callback_fptr_t callback); 51 void LeaveThread(__spinlock_t * lock, thread_desc * thrd); 36 void __leave_thread() __attribute__((noreturn)); 52 37 53 38 //----------------------------------------------------------------------------- 54 39 // Processor 55 40 void main(processorCtx_t *); 41 42 void * __create_pthread( pthread_t *, void * (*)(void *), void * ); 56 43 57 44 static inline void wake_fast(processor * this) { … … 84 71 // Threads 85 72 extern "C" { 86 forall(dtype T | is_thread(T)) 87 void CtxInvokeThread(T * this); 73 void __cfactx_invoke_thread(void (*main)(void *), void * this); 88 74 } 89 75 90 extern void ThreadCtxSwitch(coroutine_desc * src, coroutine_desc * dst);91 92 76 __cfaabi_dbg_debug_do( 93 extern void __cfaabi_dbg_thread_register ( thread_desc* thrd );94 extern void __cfaabi_dbg_thread_unregister( thread_desc* thrd );77 extern void __cfaabi_dbg_thread_register ( $thread * thrd ); 78 extern void __cfaabi_dbg_thread_unregister( $thread * thrd ); 95 79 ) 96 80 … … 99 83 #define KERNEL_STORAGE(T,X) static char storage_##X[sizeof(T)] 100 84 85 static inline uint32_t __tls_rand() { 86 kernelTLS.rand_seed ^= kernelTLS.rand_seed << 6; 87 kernelTLS.rand_seed ^= kernelTLS.rand_seed >> 21; 88 kernelTLS.rand_seed ^= kernelTLS.rand_seed << 7; 89 return kernelTLS.rand_seed; 90 } 91 101 92 102 93 void doregister( struct cluster & cltr ); 103 94 void unregister( struct cluster & cltr ); 104 95 105 void doregister( struct cluster * cltr, struct thread_desc& thrd );106 void unregister( struct cluster * cltr, struct thread_desc& thrd );96 void doregister( struct cluster * cltr, struct $thread & thrd ); 97 void unregister( struct cluster * cltr, struct $thread & thrd ); 107 98 108 99 void doregister( struct cluster * cltr, struct processor * proc );
Note:
See TracChangeset
for help on using the changeset viewer.