File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,11 @@ namespace px_sched {
211
211
T element;
212
212
#if PX_SCHED_CACHE_LINE_SIZE
213
213
// Avoid false sharing between threads
214
- char padding[PX_SCHED_CACHE_LINE_SIZE];
214
+ static const size_t PADDING_ADJUSTMENT =
215
+ ( PX_SCHED_CACHE_LINE_SIZE
216
+ - ((sizeof (state)+sizeof (version)+sizeof (element))%PX_SCHED_CACHE_LINE_SIZE)
217
+ ) % PX_SCHED_CACHE_LINE_SIZE;
218
+ char padding[PADDING_ADJUSTMENT];
215
219
#endif
216
220
};
217
221
D *data_ = nullptr ;
@@ -423,6 +427,11 @@ namespace px_sched {
423
427
static void WorkerThreadMain (Scheduler *schd, Worker *);
424
428
#endif
425
429
430
+ #ifdef PX_SCHED_CONFIG_SINGLE_THREAD
431
+ ObjectPool<Task> tasks_;
432
+ ObjectPool<Counter> counters_;
433
+ #endif // PX_SCHED_CONFIG_SINGLE_THREAD
434
+
426
435
};
427
436
428
437
// -- Optional: Mutex template to encapsultae scheduler notification ----------
You can’t perform that action at this time.
0 commit comments