📄 rthreadtest.cpp
字号:
#include <e32std.h>
#include <e32cons.h>
#include <e32base.h>
_LIT(KTxtMYThread,"MYThread");
struct TArg
{
TInt x;
TInt y;
TBuf<32> notes;
};
static TInt callback (TAny* aParameters);
GLDEF_C TInt E32Main() // main function called by E32
{
TArg arg;
arg.x = 0;
arg.y = 100;
arg.notes.Copy(_L("hell!"));
const TInt KHeapSize = 0x800 ;
RThread thread ;
TRequestStatus iStatus;
TInt result = thread.Create(KTxtMYThread,(TThreadFunction)callback, KDefaultStackSize,
KMinHeapSize, KHeapSize, &arg, EOwnerThread) ;
User::LeaveIfError(result) ;
thread.Resume();
thread.Close();
return 0; // and return
}
static TInt callback (TAny* aParameters)
{
TArg * arg = (TArg *)aParameters;
User::InfoPrint(arg->notes);
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -