+
+//Remove canceled thread from user data registry
+int pthread_user_data_remove(pthread_t thread) {
+ //FIXME: not implemented yet!
+ (void) thread;
+ return 0;
+}
+
+//User data cleanup handler to be registered with pthread_cleanup_push()
+void pthread_user_data_cleanup( void * arg ) {
+ pthread_t t = (pthread_t)arg;
+ assert(pthread_equal(t, pthread_self()) && "Pthread_self() is not working in cleanup context!");
+ pthread_user_data_remove(t);
+}