Hi I need an example of how threads are coded and implemented in Dev-C++, any help would be greatly appreciated. :)
CodeBoy101
-2
Junior Poster in Training
Recommended Answers
Jump to PostTry this and see if it works..... But the problem is some libraries does not support
(#include "XYLock.h")#include <stdio.h> #include <iostream> #include "XYLock.h" XYCriticalSection myCriticalSection; void ThreadProc(void *dummy) { while(true) { try { XYLock myLock(&myCriticalSection); printf("Thread '%X' has the lock\n",::GetCurrentThreadId()); throw "a test"; } catch(char* p) …
Jump to PostAs AncientDragon said, CreateThread() can be used in windows. Check it out on MSDN. Following is some code to show you how to use it. Note that the thread proc should be of the form
DWORD WINAPI myThreadProc(void*someData)
. someData is a pointer passed by CreateThread to your thread …
All 7 Replies
Traicey
10
Posting Whiz in Training
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
CodeBoy101
-2
Junior Poster in Training
dougy83
74
Posting Whiz in Training
CodeBoy101
commented:
Sweet!!
+1
CodeBoy101
-2
Junior Poster in Training
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
CodeBoy101
-2
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.