Fresh IDE . TestPThreads.asm at [947e41d975]
Not logged in

This repository is a mirror!

The original is located on: https://fresh.flatassembler.net/fossil/repo/fresh
If you want to follow the project, please update your remote-url

File freshlib/test_code/TestPThreads.asm artifact 050bac7a42 part of check-in 947e41d975


; _______________________________________________________________________________________
;|                                                                                       |
;| ..:: Fresh IDE ::..  template project.                                                |
;|_______________________________________________________________________________________|
;
;  Description: FreshLib portable console application.
;
;  Target OS: Any, supported by FreshLib
;
;  Dependencies: FreshLib
;
;  Notes:
;_________________________________________________________________________________________

include "%lib%/freshlib.inc"

@BinaryType console

include "%lib%/freshlib.asm"

; include your includes here.

iglobal
  Stop dd 0
endg

start:
        InitializeAll

        stdcall ThreadCreate, TestThread, 0

.wait:
        stdcall Sleep, 100
        cmp     [Stop], 0
        je      .wait

        FinalizeAll
        stdcall TerminateAll, 0


proc TestThread, .arg
begin
        mov     esi, esp
        mov     ecx, 8000

.touch:
        sub     esp, 2048
        mov     eax, [esp]
        loop    .touch

        mov     [Stop], 1
        mov     esp, esi
        cret
endp


@AllImportEmbeded       ; or @AllImportSection
@AllDataEmbeded         ; or @AllDataSection