Difference between revisions of "KMutex"

From 3dbrew
Jump to navigation Jump to search
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:Kernel objects]]
+
[[Category:Kernel synchronization objects]]
 
class [[KMutex]] extends [[KSynchronizationObject]];
 
class [[KMutex]] extends [[KSynchronizationObject]];
  
Line 20: Line 20:
 
| 0x8
 
| 0x8
 
| u32
 
| u32
| KLinkedListNode count for object
+
| Node count for threads
 
|-
 
|-
 
| 0xC
 
| 0xC
| u32
+
| [[KLinkedListNode]]*
| Pointer to itself + 0x14
+
| Pointer to first KLinkedListNode in the list of threads that sync with this object
 
|-
 
|-
 
| 0x10
 
| 0x10
| u32
+
| [[KLinkedListNode]]*
| Pointer to itself + 0x14
+
| Pointer to last KLinkedListNode in the list of threads that sync with this object
 
|-
 
|-
 
| 0x14
 
| 0x14
| KLinkedListNode*
+
| KMutexLinkedListNode
| Next
+
| Previous and next mutexes
|-
 
| 0x18
 
| KLinkedListNode*
 
| Previous
 
 
|-
 
|-
 
| 0x1C
 
| 0x1C
 
| u32
 
| u32
| Unknown 1 locked 0 unlocked?
+
| Threads using this mutex
 
|-
 
|-
 
| 0x20
 
| 0x20
| u32
+
| [[KThread]] *
| Unknown 1 locked 0 unlocked?
+
| Thread that has the KMutex locked
 
|-
 
|-
 
| 0x24
 
| 0x24
 
| u32
 
| u32
| Unknown 0x3F ?maybe priority?
+
| Priority
 
|-
 
|-
 
| 0x28
 
| 0x28
| KProcess*
+
| [[KProcess]]*
 
| Owner
 
| Owner
 
|-
 
|-
 +
|}
 +
 +
With the following declarations: <code>struct KMutexLinkedList { KMutex *first, *last; };</code> and <code>struct KMutexLinkedListNode { KMutex *prev, *next; };</code>.

Latest revision as of 00:50, 10 December 2016

class KMutex extends KSynchronizationObject;

Size : 0x2C bytes

Offset Type Description
0x0 u32 Pointer to vtable
0x4 u32 Reference count
0x8 u32 Node count for threads
0xC KLinkedListNode* Pointer to first KLinkedListNode in the list of threads that sync with this object
0x10 KLinkedListNode* Pointer to last KLinkedListNode in the list of threads that sync with this object
0x14 KMutexLinkedListNode Previous and next mutexes
0x1C u32 Threads using this mutex
0x20 KThread * Thread that has the KMutex locked
0x24 u32 Priority
0x28 KProcess* Owner

With the following declarations: struct KMutexLinkedList { KMutex *first, *last; }; and struct KMutexLinkedListNode { KMutex *prev, *next; };.