Subversion Repositories Kolibri OS

Rev

Rev 2 | Rev 379 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 115
Line 25... Line 25...
25
  call change_task
25
  call change_task
26
  jmp  start_wait
26
  jmp  start_wait
27
ok=$
27
ok=$
28
  push eax
28
  push eax
29
  mov  eax,dword [0x3010+second_base_address]
29
  mov  eax,dword [0x3010+second_base_address]
30
  mov  eax,[eax+0x4]
30
  mov  eax,[eax+TASKDATA.pid]
31
  mov  [name],eax
31
  mov  [name],eax
32
  pop  eax
32
  pop  eax
33
  sti
33
  sti
34
}
34
}
35
macro ReleaseSimpleMutex name
35
macro ReleaseSimpleMutex name
Line 59... Line 59...
59
macro WaitSimpleCriticalSection name
59
macro WaitSimpleCriticalSection name
60
{
60
{
61
  local start_wait,first_wait,inc_counter,end_wait
61
  local start_wait,first_wait,inc_counter,end_wait
62
  push  eax
62
  push  eax
63
  mov   eax,[0x3010+second_base_address]
63
  mov   eax,[0x3010+second_base_address]
64
  mov   eax,[eax+0x4]
64
  mov   eax,[eax+TASKDATA.pid]
65
start_wait=$
65
start_wait=$
66
  cli
66
  cli
67
  cmp   [name],dword 0
67
  cmp   [name],dword 0
68
  jz    first_wait
68
  jz    first_wait
69
  cmp   [name],eax
69
  cmp   [name],eax
Line 91... Line 91...
91
}
91
}
92
macro TryWaitSimpleCriticalSection name ;result in eax and in flags
92
macro TryWaitSimpleCriticalSection name ;result in eax and in flags
93
{
93
{
94
  local ok,try_end
94
  local ok,try_end
95
  mov   eax,[0x3000+second_base_address]
95
  mov   eax,[0x3000+second_base_address]
96
  mov   eax,[eax+0x4]
96
  mov   eax,[eax+TASKDATA.pid]
97
  cmp   [name],eax
97
  cmp   [name],eax
98
  jz    ok
98
  jz    ok
99
  cmp   [name],0
99
  cmp   [name],0
100
  jz    ok
100
  jz    ok
101
  xor   eax,eax
101
  xor   eax,eax