| 44 | } |
| 45 | |
| 46 | FancyRefPtr<MessageEndpoint> MessageInterface::Connect(){ |
| 47 | if(!active){ |
| 48 | return FancyRefPtr<MessageEndpoint>(); |
| 49 | } |
| 50 | |
| 51 | Pair<int, FancyRefPtr<MessageEndpoint>> connection; |
| 52 | |
| 53 | connection.item1 = false; |
| 54 | |
| 55 | acquireLock(&incomingLock); |
| 56 | incoming.add_back(&connection); |
| 57 | releaseLock(&incomingLock); |
| 58 | |
| 59 | acquireLock(&waitingLock); |
| 60 | while(waiting.get_length() > 0){ |
| 61 | waiting.remove_at(0)->Signal(); |
| 62 | } |
| 63 | releaseLock(&waitingLock); |
| 64 | |
| 65 | while(!connection.item1){ |
| 66 | Scheduler::Yield(); |
| 67 | } |
| 68 | |
| 69 | return connection.item2; |
| 70 | } |
nothing calls this directly
no test coverage detected