Skip to content
Snippets Groups Projects
Commit 8effc6ac authored by rswindell's avatar rswindell
Browse files

incom() and inkey() now support timeout value (defaults to 0).

output_sem is not part of outbuf ring buffer (outbuf.sem).
parent 46fb51f9
No related branches found
No related tags found
No related merge requests found
...@@ -155,13 +155,12 @@ public: ...@@ -155,13 +155,12 @@ public:
RingBuf inbuf; RingBuf inbuf;
RingBuf outbuf; RingBuf outbuf;
sem_t output_sem;
HANDLE input_thread; HANDLE input_thread;
pthread_mutex_t input_thread_mutex; pthread_mutex_t input_thread_mutex;
bool input_thread_mutex_locked; // by someone other than the input_thread bool input_thread_mutex_locked; // by someone other than the input_thread
int outcom(uchar ch); // send character int outcom(uchar ch); // send character
int incom(void); // receive character int incom(unsigned long timeout=0); // receive character
void spymsg(char *msg); // send message to active spies void spymsg(char *msg); // send message to active spies
...@@ -483,7 +482,7 @@ public: ...@@ -483,7 +482,7 @@ public:
void mnemonics(char *str); void mnemonics(char *str);
/* inkey.cpp */ /* inkey.cpp */
char inkey(long mode); /* Returns key if one has been hit */ char inkey(long mode, unsigned long timeout=0);
char handle_ctrlkey(char ch, long mode=0); char handle_ctrlkey(char ch, long mode=0);
/* prntfile.cpp */ /* prntfile.cpp */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment