Don't use pthread on OpenBSD

since OpenBSD pthread does not support pthread_condattr_setpshared().
This patch could also stay in the OpenBSD ports tree or depend on a
configure test macro rather than defined __OpenBSD__.
This commit is contained in:
Christopher Zimmermann
2016-06-11 13:05:29 +02:00
parent 87e90229bc
commit 1322af1e4f
4 changed files with 39 additions and 7 deletions

View File

@ -11,7 +11,9 @@
#pragma once
#include <stdint.h>
#if !defined(__OpenBSD__)
#include <pthread.h>
#endif
/* Default shmlog size if not set by user. */
extern const int default_shmlog_size;
@ -37,8 +39,10 @@ typedef struct i3_shmlog_header {
* and dont matter — clients use an equality check (==). */
uint32_t wrap_count;
#if !defined(__OpenBSD__)
/* pthread condvar which will be broadcasted whenever there is a new
* message in the log. i3-dump-log uses this to implement -f (follow, like
* tail -f) in an efficient way. */
pthread_cond_t condvar;
#endif
} i3_shmlog_header;