aboutsummaryrefslogtreecommitdiffstats
path: root/x11/nvidia-driver/files/100xx-patch-src::nvidia.os
blob: 3a9ae65095c9feb3b273f110203087dee192a7b6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
--- src/nvidia_os.c.orig    2007-07-24 21:06:12.000000000 +0200
+++ src/nvidia_os.c 2007-07-24 21:17:09.000000000 +0200
@@ -598,7 +598,7 @@
             != RM_OK))
         return status;
 
-    mtx_init(&mtx->mutex_mtx, "rm.mutex_mtx", NULL, MTX_SPIN | MTX_RECURSE);
+    mtx_init(&mtx->mutex_mtx, "rm.mutex_mtx", NULL, MTX_DEF | MTX_RECURSE);
     cv_init(&mtx->mutex_wait, "rm.mutex_wait");
 
     mtx->refcnt = 1;
@@ -624,13 +624,13 @@
 {
     struct os_mutex *mtx = semaphore;
 
-    mtx_lock_spin(&mtx->mutex_mtx);
+    mtx_lock(&mtx->mutex_mtx);
     if (mtx->refcnt > 0)
         rm_disable_interrupts(NULL);
     mtx->refcnt--;
     if (mtx->refcnt < 0)
         cv_wait(&mtx->mutex_wait, &mtx->mutex_mtx);
-    mtx_unlock_spin(&mtx->mutex_mtx);
+    mtx_unlock(&mtx->mutex_mtx);
 
     return RM_OK;
 }
@@ -639,14 +639,14 @@
 {
     struct os_mutex *mtx = semaphore;
 
-    mtx_lock_spin(&mtx->mutex_mtx);
+    mtx_lock(&mtx->mutex_mtx);
     if (mtx->refcnt < 1) {
-        mtx_unlock_spin(&mtx->mutex_mtx);
+        mtx_unlock(&mtx->mutex_mtx);
         return FALSE;
     } else {
         rm_disable_interrupts(NULL);
         mtx->refcnt--;
-        mtx_unlock_spin(&mtx->mutex_mtx);
+        mtx_unlock(&mtx->mutex_mtx);
     }
 
     return TRUE;
@@ -656,13 +656,13 @@
 {
     struct os_mutex *mtx = semaphore;
 
-    mtx_lock_spin(&mtx->mutex_mtx);
+    mtx_lock(&mtx->mutex_mtx);
     if (mtx->refcnt < 0)
         cv_signal(&mtx->mutex_wait);
     if (!mtx->refcnt)
         rm_enable_interrupts(NULL);
     mtx->refcnt++;
-    mtx_unlock_spin(&mtx->mutex_mtx);
+    mtx_unlock(&mtx->mutex_mtx);
 
     return RM_OK;
 }