#include <error.h>
#include <errno.h>
#include <stdint.h>
+#include <pthread.h>
struct event_handler;
char *name;
};
+struct mutex {
+ pthread_mutex_t lock;
+ int line;
+ char *file;
+ time_t lock_time;
+ char *name;
+};
+
int register_event_handler(struct event_handler *handler);
int get_child_count(void);
int run_piped_stream(const char *cmd, char *const argv[],
FILE **stdinf, FILE **stdoutf, FILE **stderrf);
+void _mutex_lock_acquired(struct mutex *lock, char *file, int line);
+int _mutex_lock(struct mutex *lock, char *file, int line);
+int _mutex_unlock(struct mutex *lock);
+
+#define mutex_lock(lock) _mutex_lock(lock, __FILE__, __LINE__)
+#define mutex_unlock(lock) _mutex_unlock(lock)
+#define mutex_lock_acquired(lock) _mutex_lock_acquired(lock, __FILE__, __LINE__)
#endif