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


	void processCommand() volatile {

		printf("KernelWrapper processCommand: %d\n", command);

		switch (command) {


				lock_thread_id, (has_task) ? "true" : "false");
	}

	void start_monitoring() {
		printf("KernelWrapper start monitor thread\n");
		pthread_create(&t_monitor, NULL, &KernelWrapper::thread, this);
	}

