MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / Connect

Method Connect

Kernel/src/objects/interface.cpp:46–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46FancyRefPtr<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}

Callers

nothing calls this directly

Calls 5

SignalMethod · 0.80
YieldFunction · 0.50
add_backMethod · 0.45
get_lengthMethod · 0.45
remove_atMethod · 0.45

Tested by

no test coverage detected