原创 Android native線程

先來看一下線程頭文件threads.h class Thread : virtual public RefBase { public: // Create a Thread object, but doesn't create

原创 How to Become a Software Architect

I often get asked by up-and-coming technologists, "what things should I be doing to work towards becoming an architect"

原创 使用linux中標準的queue.h頭文件插件鏈表,隊列,循環隊列

#include <stdio.h>#include <stdlib.h> #include <string.h> #include <sys/qu

原创 getopt_long

#include <stdio.h>     /* for printf */ #include <stdlib.h>    /* for exit

原创 Android Native常見類

template <class TYPE> class Vector : private VectorImpl { public: typedef TYPE value_type; /*!

原创 main_mediaserver

1.main_mediaserver入口 int main(int argc, char** argv) { sp<ProcessState> proc(ProcessState::self()); sp<

原创 Friend functions and classes

For much of this chapter, we’ve been preaching the virtues of keeping your data private. However, you may occasionally

原创 getopt

#include <unistd.h> #include <stdlib.h> #include <stdio.h> int main(int ar

原创 defaultServiceManager

1.我們先來看一下IServiceManager.h class IServiceManager : public IInterface { public: DECLARE_META_INTERFACE(ServiceManage

原创 C調用C++函數

1.C++代碼 #include <iostream> using namespace std; extern "C" void func(void) { cout << "This is a C++ code" << en

原创 dropbear

1.Ubuntu上移植dropbear支持ssh server     1)編譯zlib     2)編譯dropbear     3)生產key           sudo mkdir /etc/dropbear          

原创 Service Manager

1.system/core/rootdir/init.rc service servicemanager /system/bin/servicemanager class core user system grou

原创 misc device

1.mybinder.c #include <linux/miscdevice.h> #include <linux/delay.h> #include <linux/kernel.h> #include <linux/module.h

原创 線程同步

測試程序: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <pthread.h> #include <time.h> static pthread

原创 IPCThreadState

1.先看看IPCThreadState的聲明 class IPCThreadState { public: static IPCThreadState* self(); static IPCThreadSta