1
0
mirror of https://github.com/ioacademy-jikim/android_framwork synced 2025-06-07 07:56:34 +00:00
This commit is contained in:
ioacademy-jikim 2018-06-15 11:30:40 +09:00
parent 7a0a2db279
commit cf1e4e5d56
2 changed files with 53 additions and 1 deletions

Binary file not shown.

View File

@ -1,3 +1,40 @@
#if 0
#include <stdio.h>
#include <utils/Thread.h>
#include <utils/StrongPointer.h>
using namespace android;
//--------------------------------------------------------
class AAA : public RefBase
{
int ratio=0;
public:
AAA()
{
printf("AAA::AAA()\n");
}
void onFirstRef()
{
ratio = 100;
printf("AAA::onFirstRef()\n");
}
bool foo(void)
{
printf("AAA::foo()\n");
return false;
}
};
int main()
{
sp<AAA> pa = new AAA;
//AAA *pa = new AAA;
pa->foo();
//delete pa;
return 0;
}
#endif
#if 1
#include <stdio.h>
#include <utils/Thread.h>
@ -9,11 +46,26 @@ class MyThread : public Thread
{
int volume;
public:
MyThread()
{
printf("MyThread::MyThread()\n");
}
void onFirstRef()
{
printf("MyThread::onFirstRef()\n");
}
status_t readyToRun()
{
printf("MyThread::readyToRun()\n");
return NO_ERROR;
}
bool threadLoop(void)
{
volume=100;
printf("MyThread::threadLoop(), volume=%d\n", volume);
return false;
sleep(1);
return true;
}
};
int main()