Data update
This commit is contained in:
parent
ed705008a8
commit
0df55f9f24
2196 changed files with 32999 additions and 3075 deletions
|
|
@ -0,0 +1,46 @@
|
|||
#ifdef __FB_WIN32__
|
||||
' ... instructions only for Win ...
|
||||
#Include "windows.bi"
|
||||
|
||||
Function ThreadFunc As Dword Cdecl Alias "ThreadFunc"(param As Any Ptr) Export
|
||||
Print "Thread running"
|
||||
Function = 0
|
||||
End Function
|
||||
|
||||
Dim As HANDLE thread
|
||||
Dim As Dword threadId
|
||||
|
||||
thread = CreateThread(NULL, 0, @ThreadFunc, NULL, 0, @threadId)
|
||||
|
||||
If thread = NULL Then
|
||||
Print "Error creating thread"
|
||||
Sleep
|
||||
End 1
|
||||
End If
|
||||
|
||||
WaitForSingleObject(thread, INFINITE)
|
||||
#endif
|
||||
|
||||
#ifdef __FB_LINUX__
|
||||
' ... instructions only for Linux ...
|
||||
#Include "crt/pthread.bi"
|
||||
|
||||
Function ThreadFunc As Any Ptr Cdecl Alias "ThreadFunc"(param As Any Ptr) Export
|
||||
Print "Thread running"
|
||||
Function = 0
|
||||
End Function
|
||||
|
||||
Dim As pthread_t thread
|
||||
|
||||
If pthread_create(@thread, NULL, @ThreadFunc, NULL) <> 0 Then
|
||||
Print "Error creating thread"
|
||||
Sleep
|
||||
End 1
|
||||
End If
|
||||
|
||||
pthread_join(thread, NULL)
|
||||
#endif
|
||||
|
||||
Print "Thread finished"
|
||||
|
||||
Sleep
|
||||
Loading…
Add table
Add a link
Reference in a new issue