You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (static_cast<ppu_thread*>(cpu)->state & cpu_flag::again)
162
+
std::lock_guard lock(cond.mutex->mutex);
163
+
164
+
if (ppu.state & cpu_flag::suspend)
155
165
{
156
-
ppu.state += cpu_flag::again;
166
+
// Test if another signal caused the current thread to be suspended, in which case it needs to wait until the thread wakes up (otherwise the signal may cause unexpected results)
167
+
finished = false;
157
168
return;
158
169
}
159
170
160
-
// TODO: Is EBUSY returned after reqeueing, on sys_cond_destroy?
171
+
if (constauto cpu = cond.schedule<ppu_thread>(cond.sq, cond.mutex->protocol))
172
+
{
173
+
if (static_cast<ppu_thread*>(cpu)->state & cpu_flag::again)
174
+
{
175
+
ppu.state += cpu_flag::again;
176
+
return;
177
+
}
178
+
179
+
// TODO: Is EBUSY returned after reqeueing, on sys_cond_destroy?
// Test if another signal caused the current thread to be suspended, in which case it needs to wait until the thread wakes up (otherwise the signal may cause unexpected results)
if (!idm::check_unlocked<named_thread<ppu_thread>>(thread_id))
315
+
{
316
+
return -1;
317
+
}
242
318
243
-
for (auto cpu = +cond.sq; cpu; cpu = cpu->next_cpu)
319
+
if (atomic_storage<ppu_thread*>::load(cond.sq))
244
320
{
245
-
if (cpu->id == thread_id)
321
+
std::lock_guard lock(cond.mutex->mutex);
322
+
323
+
if (ppu.state & cpu_flag::suspend)
246
324
{
247
-
if (static_cast<ppu_thread*>(cpu)->state & cpu_flag::again)
325
+
// Test if another signal caused the current thread to be suspended, in which case it needs to wait until the thread wakes up (otherwise the signal may cause unexpected results)
326
+
finished = false;
327
+
return0;
328
+
}
329
+
330
+
for (auto cpu = +cond.sq; cpu; cpu = cpu->next_cpu)
331
+
{
332
+
if (cpu->id == thread_id)
248
333
{
249
-
ppu.state += cpu_flag::again;
250
-
return0;
251
-
}
334
+
if (static_cast<ppu_thread*>(cpu)->state & cpu_flag::again)
0 commit comments