Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
maestro-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
maestro
maestro-core
Commits
0b115178
Commit
0b115178
authored
3 years ago
by
Utz-Uwe Haus
Browse files
Options
Downloads
Patches
Plain Diff
improve cond_timedwait reporting in cleanup_waitup
parent
7da0c636
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
maestro/i_event.h
+15
-6
15 additions, 6 deletions
maestro/i_event.h
with
15 additions
and
6 deletions
maestro/i_event.h
+
15
−
6
View file @
0b115178
...
...
@@ -53,6 +53,7 @@
#include
<stdatomic.h>
#include
<stdint.h>
#include
<pthread.h>
#include
<errno.h>
/* how much (in sec) are we willing to wait for generic table to be cleared */
...
...
@@ -60,6 +61,7 @@
/** Generic timed wait on hash table proper cleanup
**/
/* this should really be a function, not a macro, but HTABLE_COUNT does not take generic args */
#define mstro_cleanup_waitup(retstat,htable,lock,cond,reason) { \
retstat = MSTRO_OK; \
do { \
...
...
@@ -78,16 +80,23 @@
} \
\
unsigned rem_ = HASH_COUNT(htable); \
if(
!
rem_) {
\
if(rem_
==0
) { \
INFO("All items in `%s` already completed cleanly\n", reason); \
} else { \
INFO("In `%s`, %d item(s) still pending, waiting up to %d sec\n",\
reason, rem_, MSTRO_TIMED_WAIT); \
while (HASH_COUNT(htable) && !rc_)
\
do {
\
rc_ = pthread_cond_timedwait(cond, lock, &ts); \
} while (!rc_ && HASH_COUNT(htable)>0 ); \
\
if(rc_!=0) { \
if(rc_==ETIMEDOUT) { \
ERR("Waited %zu seconds without change to table\n", \
(uint64_t)MSTRO_TIMED_WAIT); \
} else { \
ERR("Failed to perform timedwait: %d (%s)\n", \
rc_, strerror(rc_)); \
} \
retstat = MSTRO_FAIL; \
break; \
} \
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment