blob: 957388b88521dc959d8a1730fe9630e966f5f216 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
phoglund@webrtc.orgec9c9422013-01-02 08:45:03 +000011#include "webrtc/system_wrappers/interface/thread_wrapper.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000012
13#if defined(_WIN32)
phoglund@webrtc.orgec9c9422013-01-02 08:45:03 +000014#include "webrtc/system_wrappers/source/thread_win.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000015#else
phoglund@webrtc.orgec9c9422013-01-02 08:45:03 +000016#include "webrtc/system_wrappers/source/thread_posix.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000017#endif
18
19namespace webrtc {
phoglund@webrtc.orgec9c9422013-01-02 08:45:03 +000020
niklase@google.com470e71d2011-07-07 08:21:25 +000021#if defined(_WIN32)
tommi@webrtc.org361981f2015-03-19 14:44:18 +000022typedef ThreadWindows ThreadType;
niklase@google.com470e71d2011-07-07 08:21:25 +000023#else
tommi@webrtc.org361981f2015-03-19 14:44:18 +000024typedef ThreadPosix ThreadType;
niklase@google.com470e71d2011-07-07 08:21:25 +000025#endif
tommi@webrtc.org361981f2015-03-19 14:44:18 +000026
27rtc::scoped_ptr<ThreadWrapper> ThreadWrapper::CreateThread(
28 ThreadRunFunction func, void* obj, ThreadPriority prio,
29 const char* thread_name) {
30 return rtc::scoped_ptr<ThreadWrapper>(
31 new ThreadType(func, obj, prio, thread_name)).Pass();
niklase@google.com470e71d2011-07-07 08:21:25 +000032}
phoglund@webrtc.orgec9c9422013-01-02 08:45:03 +000033
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +000034} // namespace webrtc