| 1505 | } |
| 1506 | |
| 1507 | static bool joinInterpreterThread(InterpreterThread *thread) { |
| 1508 | ThreadState *ts = thread->getThreadState(); |
| 1509 | if (ts && ts->parent != pthread_self()) { |
| 1510 | return false; |
| 1511 | } |
| 1512 | ts->lock.lock(); |
| 1513 | string quit("q"); |
| 1514 | ts->to_thread.push(quit); |
| 1515 | ts->to_cond.signal(); |
| 1516 | ts->lock.unlock(); |
| 1517 | pthread_join(ts->id, NULL); |
| 1518 | thread_lock.lock(); |
| 1519 | ts->running = false; |
| 1520 | ts->active = false; |
| 1521 | thread->clearThreadState(); |
| 1522 | thread_lock.unlock(); |
| 1523 | return true; |
| 1524 | } |
| 1525 | |
| 1526 | static BOOLEAN joinThread(leftv result, leftv arg) { |
| 1527 | if (wrong_num_args("joinThread", arg, 1)) |
no test coverage detected