copy a memdev_mutex.c