 
 				pthread_mutex_t *lock =
 						(pthread_mutex_t *) &_this->mutex_process_command;
-				int result = pthread_mutex_trylock(lock);
+
+				pthread_mutex_lock(lock);
 				printf(
-						"KernelWrapper thread: %p, trylock(mutex_process_command): %d mutex: %p\n",
-						pthread_self(), result, lock);
-
-				if (result != 0) {
-					pthread_mutex_lock(lock);
-				}
+						"KernelWrapper thread: %p, LOCKED(mutex_process_command)\n",
+						pthread_self());
 				_this->processCommand();
 				_this->reset();
 				pthread_mutex_unlock(lock);
 				printf(
 						"KernelWrapper thread: %p, UNLOCKED(mutex_process_command)\n",
 						pthread_self());
-
 			}
 		}
 		return NULL;

			int val = d_kernelWrapper->getValue(thread_id);
			cuPrintf("Thread %d getValue: %d\n", thread_id, val);

			d_kernelWrapper->lock_thread_id = -1;
			__threadfence();
			// exit infinite loop
			break;


		}
		result_available = false;

		lock_thread_id = -1;
		return result_int;
	}

