Mercurial > love-experiments
comparison src/modules/thread/ThreadModule.cpp @ 1098:a74672ba1320 minor
Merge in channels from love-experiments
Rewritten love.thread and changed communication
method from weird system before, to channels.
| author | Bart van Strien <bart.bes+projects@gmail.com> |
|---|---|
| date | Wed, 04 Jul 2012 17:15:16 +0200 |
| parents | |
| children | ee1448bb9680 |
comparison
equal
deleted
inserted
replaced
| 1097:4819322d9cdc | 1098:a74672ba1320 |
|---|---|
| 1 /** | |
| 2 * Copyright (c) 2006-2012 LOVE Development Team | |
| 3 * | |
| 4 * This software is provided 'as-is', without any express or implied | |
| 5 * warranty. In no event will the authors be held liable for any damages | |
| 6 * arising from the use of this software. | |
| 7 * | |
| 8 * Permission is granted to anyone to use this software for any purpose, | |
| 9 * including commercial applications, and to alter it and redistribute it | |
| 10 * freely, subject to the following restrictions: | |
| 11 * | |
| 12 * 1. The origin of this software must not be misrepresented; you must not | |
| 13 * claim that you wrote the original software. If you use this software | |
| 14 * in a product, an acknowledgment in the product documentation would be | |
| 15 * appreciated but is not required. | |
| 16 * 2. Altered source versions must be plainly marked as such, and must not be | |
| 17 * misrepresented as being the original software. | |
| 18 * 3. This notice may not be removed or altered from any source distribution. | |
| 19 **/ | |
| 20 | |
| 21 #include "ThreadModule.h" | |
| 22 | |
| 23 namespace love | |
| 24 { | |
| 25 namespace thread | |
| 26 { | |
| 27 const char *ThreadModule::getName() const | |
| 28 { | |
| 29 return "love.thread.sdl"; | |
| 30 } | |
| 31 | |
| 32 LuaThread *ThreadModule::newThread(const std::string &name, love::Data *data) | |
| 33 { | |
| 34 LuaThread *lt = new LuaThread(name, data); | |
| 35 return lt; | |
| 36 } | |
| 37 | |
| 38 Channel *ThreadModule::newChannel() | |
| 39 { | |
| 40 return new Channel(); | |
| 41 } | |
| 42 | |
| 43 Channel *ThreadModule::getChannel(const std::string &name) | |
| 44 { | |
| 45 return Channel::getChannel(name); | |
| 46 } | |
| 47 | |
| 48 } // thread | |
| 49 } // love |
