blob: b469344bd10cff55994a5bd4d911617649dbf610 [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(
tommi@webrtc.orgb6817d72015-03-20 15:51:39 +000028 ThreadRunFunction func, void* obj, const char* thread_name) {
tommi@webrtc.org361981f2015-03-19 14:44:18 +000029 return rtc::scoped_ptr<ThreadWrapper>(
tommi@webrtc.orgb6817d72015-03-20 15:51:39 +000030 new ThreadType(func, obj, thread_name)).Pass();
niklase@google.com470e71d2011-07-07 08:21:25 +000031}
phoglund@webrtc.orgec9c9422013-01-02 08:45:03 +000032
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +000033} // namespace webrtc