blob: 6f023f8696c6b87c92fa0c11647be93270538bfd [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 +000021ThreadWrapper* ThreadWrapper::CreateThread(ThreadRunFunction func,
22 ThreadObj obj, ThreadPriority prio,
phoglund@webrtc.orgec9c9422013-01-02 08:45:03 +000023 const char* thread_name) {
niklase@google.com470e71d2011-07-07 08:21:25 +000024#if defined(_WIN32)
phoglund@webrtc.orgec9c9422013-01-02 08:45:03 +000025 return new ThreadWindows(func, obj, prio, thread_name);
niklase@google.com470e71d2011-07-07 08:21:25 +000026#else
phoglund@webrtc.orgec9c9422013-01-02 08:45:03 +000027 return ThreadPosix::Create(func, obj, prio, thread_name);
niklase@google.com470e71d2011-07-07 08:21:25 +000028#endif
29}
phoglund@webrtc.orgec9c9422013-01-02 08:45:03 +000030
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +000031} // namespace webrtc