Subversion Repositories Kolibri OS

Rev

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

Rev 9692 Rev 9709
Line 13... Line 13...
13
;;         GNU GENERAL PUBLIC LICENSE                              ;;
13
;;         GNU GENERAL PUBLIC LICENSE                              ;;
14
;;          Version 2, June 1991                                   ;;
14
;;          Version 2, June 1991                                   ;;
15
;;                                                                 ;;
15
;;                                                                 ;;
16
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
16
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 17... Line 17...
17
 
17
 
Line 18... Line 18...
18
$Revision: 9692 $
18
$Revision: 9709 $
Line 19... Line 19...
19
 
19
 
20
struct  SOCKET
20
struct  SOCKET
Line 1858... Line 1858...
1858
        ; Set the 'socket is blocked' flag
1858
        ; Set the 'socket is blocked' flag
1859
        or      [eax + SOCKET.state], SS_BLOCKED
1859
        or      [eax + SOCKET.state], SS_BLOCKED
Line 1860... Line 1860...
1860
 
1860
 
1861
        ; Suspend the thread
1861
        ; Suspend the thread
1862
        push    edx
-
 
1863
        mov     edx, [TASK_BASE]
-
 
1864
        mov     [edx + TASKDATA.state], TSTATE_RUN_SUSPENDED
1862
        push    edx
-
 
1863
        mov     edx, [current_slot]
Line 1865... Line 1864...
1865
        mov     edx, [current_slot]
1864
        mov     [edx + APPDATA.state], TSTATE_RUN_SUSPENDED
1866
 
1865
 
1867
        ; Remember the thread ID so we can wake it up again
1866
        ; Remember the thread ID so we can wake it up again
1868
        mov     edx, [edx + APPDATA.tid]
1867
        mov     edx, [edx + APPDATA.tid]
Line 1901... Line 1900...
1901
        mov     ebx, [eax + SOCKET.TID]
1900
        mov     ebx, [eax + SOCKET.TID]
1902
        test    ebx, ebx
1901
        test    ebx, ebx
1903
        jz      .error2
1902
        jz      .error2
1904
        xor     ecx, ecx
1903
        xor     ecx, ecx
1905
        inc     ecx
1904
        inc     ecx
1906
        ;mov     esi, TASK_DATA
-
 
1907
        mov     esi, SLOT_BASE + sizeof.APPDATA
1905
        mov     esi, SLOT_BASE + sizeof.APPDATA
1908
  .next:
1906
  .next:
1909
        ;cmp     [esi + TASKDATA.pid], ebx
-
 
1910
        cmp     [esi + APPDATA.tid], ebx
1907
        cmp     [esi + APPDATA.tid], ebx
1911
        je      .found
1908
        je      .found
1912
        inc     ecx
1909
        inc     ecx
1913
        ;add     esi, sizeof.TASKDATA
-
 
1914
        add     esi, sizeof.APPDATA
1910
        add     esi, sizeof.APPDATA
1915
        cmp     ecx, [thread_count]
1911
        cmp     ecx, [thread_count]
1916
        jbe     .next
1912
        jbe     .next
Line 1917... Line 1913...
1917
 
1913
 
Line 1941... Line 1937...
1941
 
1937
 
1942
  .un_block:
1938
  .un_block:
1943
; Socket and thread exists and socket is of blocking type
1939
; Socket and thread exists and socket is of blocking type
1944
; We'll try to unblock it.
1940
; We'll try to unblock it.
1945
        and     [eax + SOCKET.state], not SS_BLOCKED    ; Clear the 'socket is blocked' flag
1941
        and     [eax + SOCKET.state], not SS_BLOCKED    ; Clear the 'socket is blocked' flag
1946
        shl     ecx, BSF sizeof.TASKDATA
1942
        shl     ecx, BSF sizeof.APPDATA
Line 1947... Line 1943...
1947
        mov     [ecx + TASK_TABLE + TASKDATA.state], TSTATE_RUNNING  ; Run the thread
1943
        mov     [SLOT_BASE + ecx + APPDATA.state], TSTATE_RUNNING  ; Run the thread
1948
 
1944
 
1949
        DEBUGF  DEBUG_NETWORK_VERBOSE, "SOCKET_notify: Unblocked socket!\n"
1945
        DEBUGF  DEBUG_NETWORK_VERBOSE, "SOCKET_notify: Unblocked socket!\n"