summaryrefslogtreecommitdiffstats
path: root/mISDN.cpp
diff options
context:
space:
mode:
authorAndreas Eversberg2010-01-16 11:42:46 +0100
committerAndreas Eversberg2010-01-16 11:42:46 +0100
commit76c5d82d4cbdd9d75e6b6db9e51eb22d10fb44bd (patch)
treef507f2500bc308bbd3a22a01559095428c4acf24 /mISDN.cpp
parent new file: checkout-branch.sh (diff)
downloadlcr-76c5d82d4cbdd9d75e6b6db9e51eb22d10fb44bd.tar.gz
lcr-76c5d82d4cbdd9d75e6b6db9e51eb22d10fb44bd.tar.xz
lcr-76c5d82d4cbdd9d75e6b6db9e51eb22d10fb44bd.zip
Added "release" action and timeout to "execute" action.
modified: README modified: action.cpp modified: apppbx.cpp modified: apppbx.h modified: dss1.cpp modified: mISDN.cpp modified: message.h modified: route.c modified: route.h modified: socket_server.c
Diffstat (limited to 'mISDN.cpp')
-rw-r--r--mISDN.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/mISDN.cpp b/mISDN.cpp
index 3e7751e..035b78b 100644
--- a/mISDN.cpp
+++ b/mISDN.cpp
@@ -1834,8 +1834,11 @@ static int mISDN_upqueue(struct lcr_fd *fd, unsigned int what, void *instance, i
char byte;
/* unset global semaphore */
- read(fd->fd, &byte, 1);
upqueue_avail = 0;
+ // with a very small incident, upqueue_avail may be set by mISDN thread and
+ // another byte may be sent to the pipe, which causes a call to this function
+ // again with nothing in the upqueue. this is no problem.
+ read(fd->fd, &byte, 1);
/* process all ports */
mISDNport = mISDNport_first;
@@ -2060,6 +2063,9 @@ int do_layer3(struct mlayer3 *ml3, unsigned int cmd, unsigned int pid, struct l3
l3m->pid = pid;
mqueue_tail(&mISDNport->upqueue, mb);
if (!upqueue_avail) {
+ // multiple threads may cause multiple calls of this section, but this
+ // results only in multiple processing of the upqueue read.
+ // this is no problem.
upqueue_avail = 1;
char byte = 0;
write(upqueue_pipe[1], &byte, 1);