+void SHORTLOCK(tShortSpinlock *Lock)
+{
+ if( Threads_int_ThreadingEnabled() )
+ {
+ if( !*Lock ) {
+ *Lock = malloc(sizeof(pthread_mutex_t));
+ pthread_mutex_init(*Lock, NULL);
+ }
+// printf("%p: SHORTLOCK wait\n", lpThreads_This);
+ pthread_mutex_lock(*Lock);
+// printf("%p: SHORTLOCK held %p\n", lpThreads_This, __builtin_return_address(0));
+ }
+ else
+ {
+ if(*Lock) Log_KernelPanic("---", "Double short lock");
+ *Lock = (void*)1;
+ }
+}
+
+void SHORTREL(tShortSpinlock *Lock)
+{
+ if( Threads_int_ThreadingEnabled() )
+ {
+ pthread_mutex_unlock(*Lock);
+// printf("%p: SHORTLOCK rel\n", lpThreads_This);
+ }
+ else
+ {
+ if(!*Lock) Log_Notice("---", "Short release when not held");
+ *Lock = NULL;
+ }
+}
+
+int CPU_HAS_LOCK(tShortSpinlock *Lock)
+{
+ if( Threads_int_ThreadingEnabled() )
+ {
+ Log_KernelPanic("---", "TODO: CPU_HAS_LOCK with threading enabled");
+ return 0;
+ }
+ else
+ {
+ return 0;
+ }
+}