A small library that's provide helpers for programmers
Diff: MyThread.cpp
- Revision:
- 1:ee7a5f05513d
- Parent:
- 0:11d8781f1013
- Child:
- 2:6cc4c56940af
diff -r 11d8781f1013 -r ee7a5f05513d MyThread.cpp --- a/MyThread.cpp Mon Feb 16 16:30:36 2015 +0000 +++ b/MyThread.cpp Tue Feb 17 11:55:34 2015 +0000 @@ -1,5 +1,6 @@ -#include "MyThreads.h" +#include "MyThread.h" +#include "MyLibc.h" void MainTrampoline(void const *args){ MyThread *mt = (MyThread*) args; @@ -9,8 +10,7 @@ } MyThread::MyThread(const char* name){ - tName = (const char*) malloc (sizeof(char)*strlen(name)+1); - strcpy((char*)tName,name); + tName = strdup(name); } MyThread::~MyThread() {