MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / protect_affinity_mask

Method protect_affinity_mask

benchmarks/tbb/tbb_misc_ex.cpp:97–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95 }
96}
97void affinity_helper::protect_affinity_mask() {
98 if( threadMask == NULL && num_masks && process_mask ) {
99 threadMask = new basic_mask_t [num_masks];
100 memset( threadMask, 0, curMaskSize );
101 get_affinity_mask( curMaskSize, threadMask );
102 is_changed = memcmp( process_mask, threadMask, curMaskSize );
103 if( is_changed ) {
104 set_affinity_mask( curMaskSize, process_mask );
105 }
106 }
107}
108#undef curMaskSize
109
110static atomic<do_once_state> hardware_concurrency_info;

Callers 1

wake_or_launchMethod · 0.45

Calls 2

get_affinity_maskFunction · 0.85
set_affinity_maskFunction · 0.85

Tested by

no test coverage detected