- sp.slavesMask.set(slave->idx);
- slave->activeSplitPoint = activeSplitPoint;
- slave->searching = true; // Slave leaves idle_loop()
- slave->notify_one(); // Could be sleeping
+ slave->spinlock.acquire();
+
+ if (slave->can_join(activeSplitPoint))
+ {
+ activeSplitPoint->slavesMask.set(slave->idx);
+ slave->activeSplitPoint = activeSplitPoint;
+ slave->searching = true;
+ }
+
+ slave->spinlock.release();