首页 > 编程知识 正文

androiddownload目录,android downloadmanager分析

时间:2023-05-05 10:47:31 阅读:184124 作者:3544

/*

#include #include "pthread_internal.h"

extern "C" pid_t __getpid();

pid_t getpid() {

pthread_internal_t* self = __get_thread();

// Do we have a valid cached pid?

pid_t cached_pid;

if (__predict_true(self->get_cached_pid(&cached_pid))) {

return cached_pid;

}

// We're still in the dynamic linker or we're in the middle of forking, so ask the kernel.

// We don't know whether it's safe to update the cached value, so don't try.

return __getpid();

}

C++程xndgq/p>

48行

1.84 KB

/*

#include

#include "pthread_internal.h"

extern "C" pid_t __getpid();

pid_t getpid() {

pthread_internal_t* self = __get_thread();

// Do we have a valid cached pid?

pid_t cached_pid;

if (__predict_true(self->get_cached_pid(&cached_pid))) {

return cached_pid;

}

// We're still in the dynamic linker or we're in the middle of forking, so ask the kernel.

// We don't know whether it's safe to update the cached value, so don't try.

return __getpid();

}

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。