2
thread safe fifo queue for commands
3
Copyright (C) 2000 Martin Vogt
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU Library General Public License as published by
7
the Free Software Foundation.
9
For more information look at the file COPYRIGHT in this package
14
#ifndef __COMMAND_PIPE_H
15
#define __COMMAND_PIPE_H
22
This queue deals with the ugly deadlock problem.
23
We insert all commands in a queue and the thread
24
polls this queue for next commands.
29
Command** commandArray;
34
abs_thread_mutex_t pipeMut;
35
abs_thread_cond_t spaceCond;
36
abs_thread_cond_t emptyCond;
37
abs_thread_cond_t dataCond;
44
void sendCommand(Command& cmd);
45
void sendCommandNoWait(Command& cmd);
47
void waitForEmptyQueue();
50
int hasCommand(Command* dest);
51
void waitForCommand();
57
void sendCommand(Command& cmd,int lWait);
59
void lockCommandPipe();
60
void unlockCommandPipe();
63
// writer thread wait here
68
// reader thread signals this