Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
31087138
Commit
31087138
authored
Feb 25, 2015
by
Davis King
Browse files
clarified thread safety
parent
003353cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
dlib/sockstreambuf/sockstreambuf_abstract.h
dlib/sockstreambuf/sockstreambuf_abstract.h
+9
-6
No files found.
dlib/sockstreambuf/sockstreambuf_abstract.h
View file @
31087138
...
@@ -32,16 +32,17 @@ namespace dlib
...
@@ -32,16 +32,17 @@ namespace dlib
once enough data has arrived.
once enough data has arrived.
THREADING
THREADING
g
enerally speaking, this object has the same kind of threading
G
enerally speaking, this object has the same kind of threading
restrictions as a connection object. those being:
restrictions as a connection object. those being:
-
d
o not try to write to a sockstreambuf from more than one thread
-
D
o not try to write to a sockstreambuf from more than one thread
.
-
d
o not try to read from a sockstreambuf from more than one thread
-
D
o not try to read from a sockstreambuf from more than one thread
.
-
y
ou may call shutdown() on the connection object and this will
-
Y
ou may call shutdown() on the connection object and this will
cause any reading or writing calls to end. To the sockstreambuf it
cause any reading or writing calls to end. To the sockstreambuf it
will appear the same as hitting EOF. (note that EOF for a sockstreambuf
will appear the same as hitting EOF. (note that EOF for a sockstreambuf
means that the connection has closed)
means that the connection has closed)
- it is safe to read from and write to the sockstreambuf at the same time
- It is safe to read from and write to the sockstreambuf at the same time
- it is not safe to try to putback a char and read from the stream from
from different threads so long as flushes_output_on_read()==false.
- It is not safe to try to putback a char and read from the stream from
different threads
different threads
!*/
!*/
public:
public:
...
@@ -103,6 +104,8 @@ namespace dlib
...
@@ -103,6 +104,8 @@ namespace dlib
ensures
ensures
- This function returns true if this object will flush its output buffer
- This function returns true if this object will flush its output buffer
to the network socket before performing any network read.
to the network socket before performing any network read.
- if (flushes_output_on_read() == true)
- It is not safe to make concurrent read and write calls to this object.
!*/
!*/
void
do_not_flush_output_on_read
(
void
do_not_flush_output_on_read
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment