blob: 60cf704e599b5f391af008e7d8969fa5a0200fba [file] [log] [blame]
Jon Medhurst15ce78d2014-04-10 09:02:02 +01001/**
2 * Copyright (C) ARM Limited 2010-2014. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#include "Source.h"
10
11#include "Logging.h"
12
13Source::Source() : mThreadID() {
14}
15
16Source::~Source() {
17}
18
19void Source::start() {
20 if (pthread_create(&mThreadID, NULL, runStatic, this)) {
21 logg->logError(__FILE__, __LINE__, "Failed to create source thread");
22 handleException();
23 }
24}
25
26void Source::join() {
27 pthread_join(mThreadID, NULL);
28}
29
30void *Source::runStatic(void *arg) {
31 static_cast<Source *>(arg)->run();
32 return NULL;
33}