+static int mutex_try_lock(int id)
+{
+ int ret;
+
+ DSS_DEBUG_LOG("trying to lock\n");
+ struct sembuf sops[2] = {
+ {
+ .sem_num = 0,
+ .sem_op = 0,
+ .sem_flg = SEM_UNDO | IPC_NOWAIT
+ },
+ {
+ .sem_num = 0,
+ .sem_op = 1,
+ .sem_flg = SEM_UNDO | IPC_NOWAIT
+ }
+ };
+ ret = do_semop(id, sops, 2);
+ if (ret < 0)
+ return -ERRNO_TO_DSS_ERROR(errno);
+ return 1;
+}
+