Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce PROCESSINFO_TRIGGERMODE_SEMAPHORE_PROP_TIMEOUTS and make it… #35

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/COREMOD_memory/scripts/milk-streamFITSlog
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ milk << EOF
readshmim ${STREAMNAME}
streamFITSlog ..procinfo 1
streamFITSlog ..loopcntMax -1
streamFITSlog ..triggermode 3
streamFITSlog ..triggermode 5
streamFITSlog ..triggersname ${STREAMNAME}
streamFITSlog ..triggertimeout ${cubetimeout}
streamFITSlog ..RTprio ${realtimeprio}
Expand Down
21 changes: 6 additions & 15 deletions src/CommandLineInterface/CLIcore/CLIcore_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,12 @@ typedef struct
processloopOK = processinfo_loopstep(processinfo); \
DEBUG_TRACEPOINT("waitoninputstream"); \
processinfo_waitoninputstream(processinfo); \
if (processinfo->triggerstatus != PROCESSINFO_TRIGGERSTATUS_RECEIVED) \
if (processinfo->triggerstatus == PROCESSINFO_TRIGGERSTATUS_TIMEDOUT && \
processinfo->triggermode == PROCESSINFO_TRIGGERMODE_SEMAPHORE) \
{ \
/* Don't execute loop at all upon semaphore timeout */ \
/* Except if the trigger is SEMAPHORE_PROP_TIMEOUTS */ \
/* in which case we avoid this block and keep going */ \
continue; \
} \
DEBUG_TRACEPOINT("exec_start"); \
Expand Down Expand Up @@ -938,24 +941,12 @@ static inline imageID resolveIMGID(
{
if((ERRMODE == ERRMODE_FAIL) || (ERRMODE == ERRMODE_ABORT))
{
printf("ERROR: %c[%d;%dm Cannot resolve image %s %c[%d;m\n",
(char) 27,
1,
31,
img->name,
(char) 27,
0);
PRINT_ERROR("Cannot resolve image %s\n", img->name);
abort();
}
else if(ERRMODE == ERRMODE_WARN)
{
printf("WARNING: %c[%d;%dm Cannot resolve image %s %c[%d;m\n",
(char) 27,
1,
35,
img->name,
(char) 27,
0);
PRINT_WARNING("Cannot resolve image %s\n", img->name);
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/CommandLineInterface/processtools_trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ errno_t processinfo_waitoninputstream(PROCESSINFO *processinfo)
return RETURN_SUCCESS;
}

if(processinfo->triggermode == PROCESSINFO_TRIGGERMODE_SEMAPHORE)
if(processinfo->triggermode == PROCESSINFO_TRIGGERMODE_SEMAPHORE ||
processinfo->triggermode == PROCESSINFO_TRIGGERMODE_SEMAPHORE_PROP_TIMEOUTS)
{
int semr;
int tmpstatus = PROCESSINFO_TRIGGERSTATUS_RECEIVED;
Expand Down
6 changes: 5 additions & 1 deletion src/CommandLineInterface/processtools_trigger.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@
// trigger after a time delay
#define PROCESSINFO_TRIGGERMODE_DELAY 4

// trigger when semaphore is posted AND propagate the timeout (i.e. enter the execution anyway)
#define PROCESSINFO_TRIGGERMODE_SEMAPHORE_PROP_TIMEOUTS 5

// trigger is currently waiting for input
#define PROCESSINFO_TRIGGERSTATUS_WAITING 1

// trigger has been received and we're executing the loop
#define PROCESSINFO_TRIGGERSTATUS_RECEIVED 2
// trigger has not been received but we've skipped out of the wait into the execution of the loop
#define PROCESSINFO_TRIGGERSTATUS_TIMEDOUT 3

#include "CLIcore.h"
Expand Down
Loading