+#else
+static void sum_val(uint64_t *dst, uint64_t *src)
+{
+ if (*src) {
+ *dst += *src;
+ *src = 0;
+ }
+}
+#endif
+
+static void pthread_double_unlock(pthread_mutex_t *lock1,
+ pthread_mutex_t *lock2)
+{
+#ifndef CONFIG_SFAA
+ pthread_mutex_unlock(lock1);
+ pthread_mutex_unlock(lock2);
+#endif
+}
+
+static void pthread_double_lock(pthread_mutex_t *lock1, pthread_mutex_t *lock2)
+{
+#ifndef CONFIG_SFAA
+ if (lock1 < lock2) {
+ pthread_mutex_lock(lock1);
+ pthread_mutex_lock(lock2);
+ } else {
+ pthread_mutex_lock(lock2);
+ pthread_mutex_lock(lock1);
+ }
+#endif
+}