Quellcode durchsuchen

[LibOS] shim_futex.c:Remove duplicate codes in FUTEX_WAIT_BITSET

No need to check futex_op twice when FUTEX_WAIT_BITSET.

Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Zhang Chen vor 5 Jahren
Ursprung
Commit
535c2d78df
1 geänderte Dateien mit 11 neuen und 11 gelöschten Zeilen
  1. 11 11
      LibOS/shim/src/sys/shim_futex.c

+ 11 - 11
LibOS/shim/src/sys/shim_futex.c

@@ -135,18 +135,18 @@ int shim_do_futex (int * uaddr, int op, int val, void * utime,
                 struct timespec *ts = (struct timespec*) utime;
                 // Round to microsecs
                 timeout_us = (ts->tv_sec * 1000000) + (ts->tv_nsec / 1000);
-                // Check for the CLOCK_REALTIME flag
-                if (futex_op == FUTEX_WAIT_BITSET)  {
-                    // DEP 1/28/17: Should really differentiate clocks, but
-                    // Graphene only has one for now.
-                    //&& 0 != (op & FUTEX_CLOCK_REALTIME)) {
-                    uint64_t current_time = DkSystemTimeQuery();
-                    if (current_time == 0) {
-                        ret = -EINVAL;
-                        break;
-                    }
-                    timeout_us -= current_time;
+
+                /* Check for the CLOCK_REALTIME flag
+                 * DEP 1/28/17: Should really differentiate clocks, but
+                 * Graphene only has one for now.
+                 * if (futex_op & FUTEX_CLOCK_REALTIME) { */
+
+                uint64_t current_time = DkSystemTimeQuery();
+                if (current_time == 0) {
+                    ret = -EINVAL;
+                    break;
                 }
+                timeout_us -= current_time;
             }
 
         /* Note: for FUTEX_WAIT, timeout is interpreted as a relative