亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? qthread_unix.cpp

?? QT 開發環境里面一個很重要的文件
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/******************************************************************************** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.**** This file is part of the QtCore module of the Qt Toolkit.**** This file may be used under the terms of the GNU General Public** License version 2.0 as published by the Free Software Foundation** and appearing in the file LICENSE.GPL included in the packaging of** this file.  Please review the following information to ensure GNU** General Public Licensing requirements will be met:** http://www.trolltech.com/products/qt/opensource.html**** If you are unsure which license is appropriate for your use, please** review the following information:** http://www.trolltech.com/products/qt/licensing.html or contact the** sales department at sales@trolltech.com.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.******************************************************************************/#include "qthread.h"#include "qplatformdefs.h"#include <private/qcoreapplication_p.h>#if !defined(QT_NO_GLIB)#  include "../kernel/qeventdispatcher_glib_p.h"#endif#include <private/qeventdispatcher_unix_p.h>#include "qthreadstorage.h"#include "qthread_p.h"#include <sched.h>#include <errno.h>#include <string.h>#ifndef QT_NO_THREADstatic pthread_once_t current_thread_data_once = PTHREAD_ONCE_INIT;static pthread_key_t current_thread_data_key;static void destroy_current_thread_data(void *p){    // POSIX says the value in our key is set to zero before calling    // this destructor function, so we need to set it back to the    // right value...    pthread_setspecific(current_thread_data_key, p);    reinterpret_cast<QThreadData *>(p)->deref();    // ... but we must reset it to zero before returning so we aren't    // called again (POSIX allows implementations to call destructor    // functions repeatedly until all values are zero)    pthread_setspecific(current_thread_data_key, 0);}static void create_current_thread_data_key(){    pthread_key_create(&current_thread_data_key, destroy_current_thread_data);}QThreadData *QThreadData::current(){    pthread_once(&current_thread_data_once, create_current_thread_data_key);    QThreadData *data = 0;    QThread *adopted = 0;    if (QInternal::activateCallbacks(QInternal::AdoptCurrentThread, (void **) &adopted)) {        Q_ASSERT(adopted);        data = QThreadData::get2(adopted);        pthread_setspecific(current_thread_data_key, data);        adopted->d_func()->running = true;        adopted->d_func()->finished = false;        static_cast<QAdoptedThread *>(adopted)->init();    } else {        data = reinterpret_cast<QThreadData *>(pthread_getspecific(current_thread_data_key));        if (!data) {            data = new QThreadData;            pthread_setspecific(current_thread_data_key, data);            data->thread = new QAdoptedThread(data);            data->deref();            (void) q_atomic_test_and_set_ptr(&QCoreApplicationPrivate::theMainThread, 0, data->thread);        }    }    return data;}void QAdoptedThread::init(){    d_func()->thread_id = pthread_self();}/*   QThreadPrivate*/#if defined(Q_C_CALLBACKS)extern "C" {#endiftypedef void*(*QtThreadCallback)(void*);#if defined(Q_C_CALLBACKS)}#endif#endif // QT_NO_THREADvoid QThreadPrivate::createEventDispatcher(QThreadData *data){#if !defined(QT_NO_GLIB)    if (qgetenv("QT_NO_GLIB").isEmpty())        data->eventDispatcher = new QEventDispatcherGlib;    else#endif        data->eventDispatcher = new QEventDispatcherUNIX;    data->eventDispatcher->startingUp();}#ifndef QT_NO_THREADvoid *QThreadPrivate::start(void *arg){    pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);    pthread_cleanup_push(QThreadPrivate::finish, arg);    QThread *thr = reinterpret_cast<QThread *>(arg);    QThreadData *data = QThreadData::get2(thr);    pthread_once(&current_thread_data_once, create_current_thread_data_key);    pthread_setspecific(current_thread_data_key, data);    data->ref();    data->quitNow = false;    // ### TODO: allow the user to create a custom event dispatcher    createEventDispatcher(data);    emit thr->started();    pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);    pthread_testcancel();    thr->run();    pthread_cleanup_pop(1);    return 0;}void QThreadPrivate::finish(void *arg){    QThread *thr = reinterpret_cast<QThread *>(arg);    QThreadPrivate *d = thr->d_func();    QMutexLocker locker(&d->mutex);    d->priority = QThread::InheritPriority;    d->running = false;    d->finished = true;    if (d->terminated)        emit thr->terminated();    d->terminated = false;    emit thr->finished();    if (d->data->eventDispatcher) {        d->data->eventDispatcher->closingDown();        QAbstractEventDispatcher *eventDispatcher = d->data->eventDispatcher;        d->data->eventDispatcher = 0;        delete eventDispatcher;    }    QThreadStorageData::finish(d->data->tls);    d->data->tls = 0;    d->thread_id = 0;    d->thread_done.wakeAll();}/************************************************************************** ** QThread *************************************************************************//*!    Returns the thread handle of the currently executing thread.    \warning The handle returned by this function is used for internal    purposes and should not be used in any application code. On    Windows, the returned value is a pseudo-handle for the current    thread that cannot be used for numerical comparison.*/Qt::HANDLE QThread::currentThreadId(){    // requires a C cast here otherwise we run into trouble on AIX    return (Qt::HANDLE)pthread_self();}/*  \internal    helper function to do thread sleeps, since usleep()/nanosleep()    aren't reliable enough (in terms of behavior and availability)*/static void thread_sleep(struct timespec *ti){    pthread_mutex_t mtx;    pthread_cond_t cnd;    pthread_mutex_init(&mtx, 0);    pthread_cond_init(&cnd, 0);    pthread_mutex_lock(&mtx);    (void) pthread_cond_timedwait(&cnd, &mtx, ti);    pthread_mutex_unlock(&mtx);    pthread_cond_destroy(&cnd);    pthread_mutex_destroy(&mtx);}/*!    Forces the current thread to sleep for \a secs seconds.    \sa msleep(), usleep()*/void QThread::sleep(unsigned long secs){    struct timeval tv;    gettimeofday(&tv, 0);    struct timespec ti;    ti.tv_sec = tv.tv_sec + secs;    ti.tv_nsec = (tv.tv_usec * 1000);    thread_sleep(&ti);}/*!    Causes the current thread to sleep for \a msecs milliseconds.    \sa sleep(), usleep()*/void QThread::msleep(unsigned long msecs){    struct timeval tv;    gettimeofday(&tv, 0);    struct timespec ti;    ti.tv_nsec = (tv.tv_usec + (msecs % 1000) * 1000) * 1000;    ti.tv_sec = tv.tv_sec + (msecs / 1000) + (ti.tv_nsec / 1000000000);    ti.tv_nsec %= 1000000000;    thread_sleep(&ti);}/*!    Causes the current thread to sleep for \a usecs microseconds.    \sa sleep(), msleep()*/void QThread::usleep(unsigned long usecs){    struct timeval tv;    gettimeofday(&tv, 0);    struct timespec ti;    ti.tv_nsec = (tv.tv_usec + (usecs % 1000000)) * 1000;    ti.tv_sec = tv.tv_sec + (usecs / 1000000) + (ti.tv_nsec / 1000000000);    ti.tv_nsec %= 1000000000;    thread_sleep(&ti);}/*!    Begins execution of the thread by calling run(), which should be    reimplemented in a QThread subclass to contain your code. The    operating system will schedule the thread according to the \a    priority parameter. If the thread is already running, this    function does nothing.    \sa run(), terminate()*/void QThread::start(Priority priority)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人av一区| 亚洲一级不卡视频| 欧美mv日韩mv| 日韩一二三区视频| 日韩精品一区二区三区老鸭窝| 欧美怡红院视频| 在线观看三级视频欧美| 91色.com| 欧美精品自拍偷拍动漫精品| 欧美性生活影院| 日韩情涩欧美日韩视频| 精品国精品国产| 中文字幕乱码亚洲精品一区| 日本一区二区视频在线| 国产精品久久久久久亚洲毛片| 国产精品欧美一区二区三区| 国产精品久久毛片a| 亚洲精品菠萝久久久久久久| 亚洲成人一区在线| 蜜臀av性久久久久av蜜臀妖精| 久久99国内精品| 99麻豆久久久国产精品免费 | 风间由美一区二区三区在线观看| 国产黄色成人av| av网站一区二区三区| 91在线一区二区| 欧美日韩高清在线| 久久品道一品道久久精品| 国产精品视频一二| 亚洲图片欧美视频| 精品一区中文字幕| 粉嫩av一区二区三区| 欧美亚洲尤物久久| 久久综合狠狠综合久久综合88| 国产精品视频一二| 免费高清成人在线| 91麻豆精品视频| 日韩精品中文字幕在线一区| 中文字幕在线不卡| 蜜桃在线一区二区三区| av高清不卡在线| 欧美一区二区视频在线观看2022| 久久欧美一区二区| 午夜av区久久| 成人精品国产福利| 欧美精品九九99久久| 国产亚洲一二三区| 日韩影院免费视频| 成人黄色大片在线观看| 91精品久久久久久久91蜜桃 | 亚洲不卡一区二区三区| 国产激情91久久精品导航| 欧美精品一卡二卡| 综合色天天鬼久久鬼色| 国产综合色视频| 在线不卡一区二区| 亚洲精品成人少妇| 成人免费看视频| 精品乱人伦小说| 午夜久久久久久久久久一区二区| 成人aa视频在线观看| 日韩欧美国产高清| 爽好久久久欧美精品| 色成人在线视频| 国产精品大尺度| 成人激情校园春色| 国产欧美日韩三区| 国产一区999| 2021中文字幕一区亚洲| 久久精品国产精品亚洲精品| 欧美日韩三级一区二区| 亚洲夂夂婷婷色拍ww47| 97精品视频在线观看自产线路二| 久久久亚洲高清| 久久99热国产| 精品国产免费视频| 麻豆视频一区二区| 日韩欧美国产电影| 国产主播一区二区三区| 久久嫩草精品久久久久| 国产盗摄精品一区二区三区在线| 精品国产一区二区三区四区四| 麻豆91小视频| 精品国产乱码久久| 国产黄色精品网站| 国产精品久久久久四虎| 色久优优欧美色久优优| 亚洲国产中文字幕| 欧美高清dvd| 狠狠久久亚洲欧美| 欧美激情一区二区三区| 91麻豆国产精品久久| 亚洲国产精品一区二区久久恐怖片 | 日韩午夜av电影| 极品销魂美女一区二区三区| 久久精品欧美日韩精品| 不卡视频免费播放| 首页欧美精品中文字幕| 精品久久人人做人人爽| 懂色av一区二区三区免费看| 亚洲日本在线看| 欧美精品1区2区| 国产传媒久久文化传媒| 曰韩精品一区二区| 日韩精品一区二| 91在线无精精品入口| 日韩精品1区2区3区| 国产亚洲综合av| 欧美老人xxxx18| 国产成人av影院| 性做久久久久久免费观看| 亚洲精品在线三区| 99热在这里有精品免费| 免费高清视频精品| 亚洲免费观看高清完整版在线观看| 欧美日韩国产高清一区二区三区| 麻豆视频一区二区| 亚洲一区在线免费观看| 久久久久国产免费免费 | 精品国产乱码久久久久久免费| 国产91清纯白嫩初高中在线观看| 一区二区在线看| 国产欧美日本一区二区三区| 欧美性xxxxxxxx| 成人国产精品免费网站| 免费视频最近日韩| 亚洲一二三级电影| 中文幕一区二区三区久久蜜桃| 欧美美女直播网站| av电影在线观看一区| 韩国一区二区三区| 日韩1区2区3区| 亚洲最大的成人av| 中文字幕一区二区三区在线观看| 欧美www视频| 欧美精品丝袜久久久中文字幕| av亚洲精华国产精华精华| 国产一区二区三区香蕉| 午夜精品一区二区三区电影天堂| 亚洲欧洲性图库| 久久久777精品电影网影网| 在线播放中文字幕一区| 欧美日韩久久久一区| 一本一道久久a久久精品综合蜜臀| 国产伦精品一区二区三区免费| 日本欧美韩国一区三区| 亚洲成av人影院在线观看网| 亚洲丝袜制服诱惑| 椎名由奈av一区二区三区| 国产日韩欧美精品在线| 久久久久久久久久久久久久久99 | 成人在线一区二区三区| 国产尤物一区二区在线| 激情都市一区二区| 国内偷窥港台综合视频在线播放| 日韩精品免费视频人成| 日韩成人午夜电影| 秋霞电影网一区二区| 日本v片在线高清不卡在线观看| 亚洲va天堂va国产va久| 婷婷一区二区三区| 日韩av网站免费在线| 蜜桃一区二区三区在线| 久久不见久久见中文字幕免费| 男女激情视频一区| 激情六月婷婷久久| 成人免费不卡视频| 在线欧美日韩精品| 欧美日本高清视频在线观看| 91精品国产综合久久小美女| 欧美成人一区二区三区| 久久久久久久久99精品| 久久久久综合网| 中文字幕亚洲电影| 亚洲免费电影在线| 日韩电影在线一区二区三区| 精品一区二区三区视频| 成人免费三级在线| 欧美色精品天天在线观看视频| 91精品国产综合久久久蜜臀粉嫩| 欧美一区二区视频免费观看| 欧美精品一区二区高清在线观看| 国产免费成人在线视频| 亚洲线精品一区二区三区八戒| 奇米影视一区二区三区小说| 国产大陆精品国产| 欧美日韩在线亚洲一区蜜芽| 欧美电影免费观看完整版| 欧美激情艳妇裸体舞| 午夜精品福利一区二区蜜股av| 免费在线一区观看| 91麻豆福利精品推荐| 欧美va亚洲va在线观看蝴蝶网| 亚洲国产成人自拍| 日本在线播放一区二区三区| 国产精品一品视频| 欧美另类videos死尸| 亚洲国产成人午夜在线一区| 亚洲成av人片www| 成人免费毛片片v|