summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d68fd2e)
raw | patch | inline | side by side (parent: d68fd2e)
author | Angela Stegmaier <angelabaker@ti.com> | |
Tue, 29 Mar 2016 19:19:42 +0000 (14:19 -0500) | ||
committer | Buddy Liong <a0270631@ti.com> | |
Tue, 19 Jul 2016 15:06:17 +0000 (10:06 -0500) |
A pthread_mutex cannot be locked and unlocked from a Task
context (only from a pthread context). Since IPUMM and IPC
only use Tasks, pthread_mutex cannot be used for synchronization.
Instead, use the SYS/BIOS Semaphore implementation.
Change-Id: I2121736b16255facdf40ff96423eda5936190c17
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
context (only from a pthread context). Since IPUMM and IPC
only use Tasks, pthread_mutex cannot be used for synchronization.
Instead, use the SYS/BIOS Semaphore implementation.
Change-Id: I2121736b16255facdf40ff96423eda5936190c17
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
src/ti/framework/dce/dce.c | patch | blob | history |
index ab7de66b416be902177ccc4dc062d2fe121e0c7b..7180e9c1f13a5b2829b67f1ec460344a347db53b 100644 (file)
@@ -118,7 +118,7 @@ static XDAS_Int32 viddec3_process(VIDDEC3_Handle codec, XDM2_BufDesc *inBufs, XD
static int viddec3_reloc(VIDDEC3_Handle handle, uint8_t *ptr, uint32_t len);
-static pthread_mutex_t sync_process_mutex;
+static Semaphore_Handle sync_process_sem;
typedef struct {
XDM_DataSyncHandle dataSyncHandle;
return (-1);
}
- pthread_mutex_lock(&sync_process_mutex);
+ Semaphore_pend(sync_process_sem, BIOS_WAIT_FOREVER);
dce_inv(inBufs);
dce_inv(outBufs);
dce_inv(outArgs);
- DEBUG(">> codec=%p, inBufs=%p, outBufs=%p, inArgs=%p, outArgs=%p codec_id=%d LOCK sync_process_mutex 0x%x",
- codec, inBufs, outBufs, inArgs, outArgs, codec_id, sync_process_mutex);
+ DEBUG(">> codec=%p, inBufs=%p, outBufs=%p, inArgs=%p, outArgs=%p codec_id=%d LOCK sync_process_sem 0x%x",
+ codec, inBufs, outBufs, inArgs, outArgs, codec_id, sync_process_sem);
#ifdef PSI_KPI
kpi_before_codec();
dce_clean(inArgs);
dce_clean(outArgs);
- DEBUG("codec_process codec=%p UNLOCK sync_process_mutex 0x%x", codec, sync_process_mutex);
- pthread_mutex_unlock(&sync_process_mutex);
+ DEBUG("codec_process codec=%p POST sync_process_sem 0x%x", codec, sync_process_sem);
+ Semaphore_post(sync_process_sem);
return ((Int32)ret);
}
{
Task_Params params;
Task_Params callback_params;
+ Semaphore_Params semParams;
INFO("Creating DCE server and DCE callbabk server thread...");
callback_params.priority = Thread_Priority_ABOVE_NORMAL;
Task_create(dce_callback_main, &callback_params, NULL);
- pthread_mutex_init(&sync_process_mutex, NULL);
+ Semaphore_Params_init(&semParams);
+ semParams.mode = Semaphore_Mode_BINARY;
+ sync_process_sem = Semaphore_create(1, &semParams, NULL);
return (TRUE);
}
{
DEBUG("dce_deinit");
- pthread_mutex_destroy(&sync_process_mutex);
+ Semaphore_delete(&sync_process_sem);
}
/*