diff options
Diffstat (limited to 'src/lib/syscall_mmio.C')
| -rw-r--r-- | src/lib/syscall_mmio.C | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/src/lib/syscall_mmio.C b/src/lib/syscall_mmio.C index 91e4e113b..83a4f8f82 100644 --- a/src/lib/syscall_mmio.C +++ b/src/lib/syscall_mmio.C @@ -34,26 +34,7 @@ mutex_t * mmio_xscom_mutex() // Ensure task is pinned. assert(task->affinity_pinned); - - // Get mutex from cpu structure. - mutex_t * mutex = task->cpu->xscom_mutex; - - // Create mutex if not created. - if (NULL == mutex) - { - mutex = mutex_create(); - - // Atomically update xscom_mutex with new mutex. - if (!__sync_bool_compare_and_swap(&task->cpu->xscom_mutex, NULL, mutex)) - { - // Failed, some other thread beat us to it. - - // Destroy mutex and get one created by other thread in the - // meantime. - mutex_destroy(mutex); - mutex = task->cpu->xscom_mutex; - } - } - - return mutex; + + // Return mutex from cpu structure. + return &task->cpu->xscom_mutex; } |

