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
a1daeea4
Commit
a1daeea4
authored
Oct 08, 2012
by
Davis King
Browse files
More code cleanup
parent
09fa9b17
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
dlib/bsp/bsp.cpp
dlib/bsp/bsp.cpp
+10
-0
dlib/bsp/bsp.h
dlib/bsp/bsp.h
+3
-2
No files found.
dlib/bsp/bsp.cpp
View file @
a1daeea4
...
@@ -254,6 +254,7 @@ namespace dlib
...
@@ -254,6 +254,7 @@ namespace dlib
read_thread_terminated_improperly
(
false
),
read_thread_terminated_improperly
(
false
),
outstanding_messages
(
0
),
outstanding_messages
(
0
),
num_waiting_nodes
(
0
),
num_waiting_nodes
(
0
),
num_terminated_nodes
(
0
),
buf_not_empty
(
class_mutex
),
buf_not_empty
(
class_mutex
),
terminated_signal
(
class_mutex
),
terminated_signal
(
class_mutex
),
_cons
(
cons_
),
_cons
(
cons_
),
...
@@ -526,6 +527,15 @@ namespace dlib
...
@@ -526,6 +527,15 @@ namespace dlib
auto_mutex
lock
(
class_mutex
);
auto_mutex
lock
(
class_mutex
);
if
(
error_message
.
size
()
!=
0
)
if
(
error_message
.
size
()
!=
0
)
throw
dlib
::
socket_error
(
error_message
);
throw
dlib
::
socket_error
(
error_message
);
if
(
outstanding_messages
!=
0
)
{
std
::
ostringstream
sout
;
sout
<<
"A BSP job was allowed to terminate before all sent messages have been received.
\n
"
;
sout
<<
"There are at least "
<<
outstanding_messages
<<
" messages still in flight. Make sure all sent messages
\n
"
;
sout
<<
"have a corresponding call to receive()."
;
throw
dlib
::
socket_error
(
sout
.
str
());
}
}
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
dlib/bsp/bsp.h
View file @
a1daeea4
...
@@ -117,8 +117,9 @@ namespace dlib
...
@@ -117,8 +117,9 @@ namespace dlib
void
receive
(
void
receive
(
)
)
{
{
int
junk
;
unsigned
long
id
;
if
(
receive
(
junk
))
shared_ptr
<
std
::
string
>
temp
;
if
(
receive_data
(
temp
,
id
))
throw
dlib
::
socket_error
(
"Call to bsp_context::receive() got an unexpected message."
);
throw
dlib
::
socket_error
(
"Call to bsp_context::receive() got an unexpected message."
);
}
}
...
...
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