aboutsummaryrefslogtreecommitdiffstats
path: root/executor/executor_posix.h
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-10-17 10:57:38 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-10-17 10:57:38 +0200
commitbb146866c04bc942242a53d110716f161519a721 (patch)
tree183ecb8c9c22f709b8db1cc6ffa10118ce1f81fd /executor/executor_posix.h
parenta8a0b01a8bc49b2088d33c529198d4780f66b94a (diff)
executor: improvements for akaros
1. remove workaround for pthread attrs (was fixed in akaros) 2. remove workaround for dup2 (was fixed in akaros) 3. check that we receive a program 4. implement timeout for test processes
Diffstat (limited to 'executor/executor_posix.h')
-rw-r--r--executor/executor_posix.h11
1 files changed, 2 insertions, 9 deletions
diff --git a/executor/executor_posix.h b/executor/executor_posix.h
index e75bfb3a7..e9b06b807 100644
--- a/executor/executor_posix.h
+++ b/executor/executor_posix.h
@@ -23,17 +23,10 @@ struct event_t {
void event_init(event_t* ev)
{
- // Akaros crashes on NULL attr.
- pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
- if (pthread_mutex_init(&ev->mu, &attr))
+ if (pthread_mutex_init(&ev->mu, 0))
fail("pthread_mutex_init failed");
- pthread_mutexattr_destroy(&attr);
- pthread_condattr_t cvattr;
- pthread_condattr_init(&cvattr);
- if (pthread_cond_init(&ev->cv, &cvattr))
+ if (pthread_cond_init(&ev->cv, 0))
fail("pthread_cond_init failed");
- pthread_condattr_destroy(&cvattr);
ev->state = false;
}