Skip to content

Commit

Permalink
preparation for tag info json locking
Browse files Browse the repository at this point in the history
  • Loading branch information
SciLor committed Jul 29, 2024
1 parent 66671b8 commit 5e5950a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/handler_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -2300,7 +2300,8 @@ error_t getTagInfoJson(char ruid[17], cJSON *jsonTarget, client_ctx_t *client_ct
{
contentJson_t contentJson;
/* read TAF info - would create .json if not existing */
tonie_info_t *tafInfo = getTonieInfoFromRuid(ruid, true, client_ctx->settings);
// tonie_info_t *tafInfo = getTonieInfoFromRuid(ruid, true, client_ctx->settings);
tonie_info_t *tafInfo = getTonieInfo(fullTagPath, false, client_ctx->settings);
/* now update with updated model if found. */
saveTonieInfo(tafInfo, true);
contentJson = tafInfo->json;
Expand Down
3 changes: 3 additions & 0 deletions src/mutex_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ void mutex_lock_id(char *id)
mutex_info_t *mutex_info = &mutex_list[i];
if (mutex_info->id != NULL && osStrcmp(mutex_info->id, id) == 0)
{
TRACE_WARNING("LOCK EXISTING %zu/%" PRIu8 "/%s\r\n", (size_t)&mutex_info->mutex, i, mutex_info->id);
mutex_unlock(MUTEX_ID);
mutex_lock(i);
return;
Expand All @@ -66,6 +67,7 @@ void mutex_lock_id(char *id)
if (mutex_info->id == NULL)
{
mutex_info->id = strdup(id);
TRACE_WARNING("LOCK NEW %zu/%" PRIu8 "/%s\r\n", (size_t)&mutex_info->mutex, i, mutex_info->id);
mutex_unlock(MUTEX_ID);
mutex_lock(i);
return;
Expand All @@ -85,6 +87,7 @@ void mutex_unlock_id(char *id)
mutex_info_t *mutex_info = &mutex_list[i];
if (mutex_info->id != NULL && osStrcmp(mutex_info->id, id) == 0)
{
TRACE_WARNING("UNLOCK %zu/%" PRIu8 "/%s\r\n", (size_t)&mutex_info->mutex, i, mutex_info->id);
osFreeMem(mutex_info->id);
mutex_info->id = NULL;
mutex_unlock(i);
Expand Down

0 comments on commit 5e5950a

Please sign in to comment.