mirror of https://github.com/deavmi/birchwood
Client
- Make `running` private and only read-accessile via `isRunning()` method which is available at the package level - Added todo for `engine` field Receiver - Use `isRunning()` now Sender - Use `isRunning()` now
This commit is contained in:
parent
7cfed69036
commit
f84b019416
|
@ -63,11 +63,26 @@ public class Client : Thread
|
|||
|
||||
/**
|
||||
* Eventy event engine
|
||||
*
|
||||
* (TODO: Try make private)
|
||||
*/
|
||||
package Engine engine;
|
||||
|
||||
package bool running = false;
|
||||
/**
|
||||
* Whether the client is running or not
|
||||
*/
|
||||
private bool running = false;
|
||||
|
||||
/**
|
||||
* Checks whether this client is running
|
||||
*
|
||||
* Returns: `true` if running, `false`
|
||||
* otherwise
|
||||
*/
|
||||
package bool isRunning()
|
||||
{
|
||||
return this.running;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new IRC client with the given configuration
|
||||
|
|
|
@ -110,7 +110,7 @@ public final class ReceiverThread : Thread
|
|||
*/
|
||||
private void recvHandlerFunc()
|
||||
{
|
||||
while(client.running)
|
||||
while(client.isRunning())
|
||||
{
|
||||
// TODO: We could look at libsnooze wait starvation or mutex racing (future thought)
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ public final class SenderThread : Thread
|
|||
*/
|
||||
private void sendHandlerFunc()
|
||||
{
|
||||
while(client.running)
|
||||
while(client.isRunning())
|
||||
{
|
||||
// TODO: We could look at libsnooze wait starvation or mutex racing (future thought)
|
||||
|
||||
|
|
Loading…
Reference in New Issue