diff options
author | ilsimo <ilsimo> | 2006-07-13 20:15:21 +0000 |
---|---|---|
committer | ilsimo <ilsimo> | 2006-07-13 20:15:21 +0000 |
commit | fda836169ea105f8a7ccc7632500eac6839467c5 (patch) | |
tree | 379a37845247e279ef39e5fe6f4d65ca398ffb04 /sesman/tcp.c | |
parent | 20e26f1ccd91c48a833425915a5413bf543796a1 (diff) | |
download | xrdp-proprietary-fda836169ea105f8a7ccc7632500eac6839467c5.tar.gz xrdp-proprietary-fda836169ea105f8a7ccc7632500eac6839467c5.zip |
making sesman multithread
Diffstat (limited to 'sesman/tcp.c')
-rw-r--r-- | sesman/tcp.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sesman/tcp.c b/sesman/tcp.c index 06c7f99d..372ec491 100644 --- a/sesman/tcp.c +++ b/sesman/tcp.c @@ -32,6 +32,9 @@ int DEFAULT_CC tcp_force_recv(int sck, char* data, int len) { int rcvd; + int block; + + block = lock_fork_critical_section_start(); while (len > 0) { @@ -57,6 +60,9 @@ tcp_force_recv(int sck, char* data, int len) len -= rcvd; } } + + lock_fork_critical_section_end(block); + return 0; } @@ -65,7 +71,10 @@ int DEFAULT_CC tcp_force_send(int sck, char* data, int len) { int sent; + int block; + block = lock_fork_critical_section_start(); + while (len > 0) { sent = g_tcp_send(sck, data, len, 0); @@ -90,6 +99,9 @@ tcp_force_send(int sck, char* data, int len) len -= sent; } } + + lock_fork_critical_section_end(block); + return 0; } |