1/**********
2This library is free software; you can redistribute it and/or modify it under
3the terms of the GNU Lesser General Public License as published by the
4Free Software Foundation; either version 3 of the License, or (at your
5option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
6
7This library is distributed in the hope that it will be useful, but WITHOUT
8ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
10more details.
11
12You should have received a copy of the GNU Lesser General Public License
13along with this library; if not, write to the Free Software Foundation, Inc.,
1451 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15**********/
16// Copyright (c) 1996-2020 Live Networks, Inc. All rights reserved.
17// Usage Environment
18// Implementation
19
20#include "UsageEnvironment.hh"
21
22Boolean UsageEnvironment::reclaim() {
23 // We delete ourselves only if we have no remainining state:
24 if (liveMediaPriv == NULL && groupsockPriv == NULL) {
25 delete this;
26 return True;
27 }
28
29 return False;
30}
31
32UsageEnvironment::UsageEnvironment(TaskScheduler& scheduler)
33 : liveMediaPriv(NULL), groupsockPriv(NULL), fScheduler(scheduler) {
34}
35
36UsageEnvironment::~UsageEnvironment() {
37}
38
39// By default, we handle 'should not occur'-type library errors by calling abort(). Subclasses can redefine this, if desired.
40// (If your runtime library doesn't define the "abort()" function, then define your own (e.g., that does nothing).)
41void UsageEnvironment::internalError() {
42 abort();
43}
44
45
46TaskScheduler::TaskScheduler() {
47}
48
49TaskScheduler::~TaskScheduler() {
50}
51
52void TaskScheduler::rescheduleDelayedTask(TaskToken& task,
53 int64_t microseconds, TaskFunc* proc,
54 void* clientData) {
55 unscheduleDelayedTask(task);
56 task = scheduleDelayedTask(microseconds, proc, clientData);
57}
58
59// By default, we handle 'should not occur'-type library errors by calling abort(). Subclasses can redefine this, if desired.
60void TaskScheduler::internalError() {
61 abort();
62}
63