View previous topic :: View next topic |
Author |
Message |
Dr.Disrespect Grandmaster Cheater Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Sat Jun 10, 2017 6:00 pm Post subject: The Thread Class. |
|
|
Code: |
function TestThread1(self)
print("ok1")
end
function CEButton2Click(sender)
thread1 = createNativeThread(TestThread1)
end
|
I use the code above to create a thread and do some heavy work. The code worked at the beginning, then I went on to write some other codes that were not related at all. Then , the thread code just didn't work anymore. So, I replace all the code with a single print function in TestThread1, and it doesn't get triggered.
What's the problem? What can prevent the thread class from working?
PS: I tried createThread, same result. I also read the tutorial on thread class, but the problem exists.
_________________
**************
A simple example is better then ten links. |
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8517 Location: 127.0.0.1
|
Posted: Sat Jun 10, 2017 7:39 pm Post subject: |
|
|
With CE 6.7, just tested the following and it works fine:
Code: |
function ThreadCallback(self)
print('Thread was called.');
end
createNativeThread(ThreadCallback);
|
_________________
- Retired. |
|
Back to top |
|
|
Dr.Disrespect Grandmaster Cheater Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Sat Jun 10, 2017 7:44 pm Post subject: |
|
|
atom0s wrote: | With CE 6.7, just tested the following and it works fine:
Code: |
function ThreadCallback(self)
print('Thread was called.');
end
createNativeThread(ThreadCallback);
|
|
It's weird, it is working for me now..... Don't know what really happened. O_O
Maybe it's because I get rid of "thread1=", or maybe because I restarted my CE...
Thanks anyway, atom0s.
_________________
**************
A simple example is better then ten links. |
|
Back to top |
|
|
|