Skip to content

Commit 8a1c3cb

Browse files
Make immediate and delayed (p)tag notification functions
static, as well as the waiting threads Co-authored-by: Edward A. Lee <[email protected]>
1 parent 32658b9 commit 8a1c3cb

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

core/federated/RTI/rti_remote.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ static int create_rti_server(uint16_t port, socket_type_t socket_type) {
224224
* @param e The enclave.
225225
* @param tag The tag to grant.
226226
*/
227-
void notify_tag_advance_grant_immediate(scheduling_node_t *e, tag_t tag) {
227+
static void notify_tag_advance_grant_immediate(scheduling_node_t *e, tag_t tag) {
228228
size_t message_length = 1 + sizeof(int64_t) + sizeof(uint32_t);
229229
unsigned char buffer[message_length];
230230
buffer[0] = MSG_TYPE_TAG_ADVANCE_GRANT;
@@ -249,12 +249,12 @@ void notify_tag_advance_grant_immediate(scheduling_node_t *e, tag_t tag) {
249249

250250
/**
251251
* @brief Thread that sleeps for a period of time, and then wakes up to check if
252-
* a tag advance grant needs to be sent. That is, if the pending tag have not
252+
* a tag advance grant needs to be sent. That is, if the pending tag has not
253253
* been reset to NEVER_TAG, the tag advance grant will be immediate.
254254
*
255-
* @param federate the fedarate whose tag advance grant needs to be delayed.
255+
* @param federate the federate whose tag advance grant needs to be delayed.
256256
*/
257-
void* pending_grant_thread(void* federate) {
257+
static void* pending_grant_thread(void* federate) {
258258
federate_info_t* fed = (federate_info_t*)federate;
259259

260260
interval_t sleep_interval = fed->pending_grant.time - lf_time_physical();
@@ -264,8 +264,8 @@ void* pending_grant_thread(void* federate) {
264264

265265
lf_mutex_lock(&rti_mutex);
266266

267-
// If the pending grant becomes NEVER_TAG, then this means that it should
268-
// not be sent
267+
// If the pending grant has become NEVER_TAG, then this means that it should
268+
// not be sent.
269269
if(lf_tag_compare(fed->pending_grant, NEVER_TAG) != 0) {
270270
notify_tag_advance_grant_immediate(&(fed->enclave), fed->pending_grant);
271271
fed->pending_grant = NEVER_TAG;
@@ -284,7 +284,7 @@ void* pending_grant_thread(void* federate) {
284284
* @param e The enclave.
285285
* @param tag The tag to grant.
286286
*/
287-
void notify_tag_advance_grant_delayed(scheduling_node_t *e, tag_t tag) {
287+
static void notify_tag_advance_grant_delayed(scheduling_node_t *e, tag_t tag) {
288288
federate_info_t* fed = GET_FED_INFO(e->id);
289289

290290
// Check wether there is already a pending grant
@@ -343,7 +343,7 @@ void notify_tag_advance_grant(scheduling_node_t *e, tag_t tag) {
343343
* @param e The scheduling node.
344344
* @param tag The tag to grant.
345345
*/
346-
void notify_provisional_tag_advance_grant_immediate(scheduling_node_t* e, tag_t tag) {
346+
static void notify_provisional_tag_advance_grant_immediate(scheduling_node_t* e, tag_t tag) {
347347
size_t message_length = 1 + sizeof(int64_t) + sizeof(uint32_t);
348348
unsigned char buffer[message_length];
349349
buffer[0] = MSG_TYPE_PROVISIONAL_TAG_ADVANCE_GRANT;
@@ -402,7 +402,7 @@ void notify_provisional_tag_advance_grant_immediate(scheduling_node_t* e, tag_t
402402
*
403403
* @param federate the federate whose provisional tag advance grant needs to be delayed.
404404
*/
405-
void* pending_provisional_grant_thread(void* federate) {
405+
static void* pending_provisional_grant_thread(void* federate) {
406406
federate_info_t* fed = (federate_info_t*)federate;
407407

408408
interval_t sleep_interval = fed->pending_provisional_grant.time - lf_time_physical();

0 commit comments

Comments
 (0)