Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
7325ed03
Commit
7325ed03
authored
Sep 13, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
I{REQUIRE,ASSERT} -> {REQUIRE,ASSERT} since these aren't inline anymore.
parent
31976bad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
async.c++
c++/src/kj/async.c++
+7
-7
No files found.
c++/src/kj/async.c++
View file @
7325ed03
...
...
@@ -312,7 +312,7 @@ bool PromiseNode::atomicOnReady(EventLoop::Event*& onReadyEvent, EventLoop::Even
}
else
{
// `onReadyEvent` is not null. If it is _kJ_ALREADY_READY then this promise was fulfilled
// before any dependent existed, otherwise there is already a different dependent.
KJ_
I
REQUIRE
(
oldEvent
==
_kJ_ALREADY_READY
,
"onReady() can only be called once."
);
KJ_REQUIRE
(
oldEvent
==
_kJ_ALREADY_READY
,
"onReady() can only be called once."
);
return
true
;
}
}
...
...
@@ -361,7 +361,7 @@ Maybe<const EventLoop&> TransformPromiseNodeBase::getSafeEventLoop() noexcept {
ChainPromiseNode
::
ChainPromiseNode
(
const
EventLoop
&
loop
,
Own
<
PromiseNode
>
inner
)
:
Event
(
loop
),
state
(
PRE_STEP1
),
inner
(
kj
::
mv
(
inner
))
{
KJ_
I
REQUIRE
(
this
->
inner
->
isSafeEventLoop
(
loop
));
KJ_
D
REQUIRE
(
this
->
inner
->
isSafeEventLoop
(
loop
));
arm
();
}
...
...
@@ -373,7 +373,7 @@ bool ChainPromiseNode::onReady(EventLoop::Event& event) noexcept {
switch
(
state
)
{
case
PRE_STEP1
:
case
STEP1
:
KJ_
I
REQUIRE
(
onReadyEvent
==
nullptr
,
"onReady() can only be called once."
);
KJ_REQUIRE
(
onReadyEvent
==
nullptr
,
"onReady() can only be called once."
);
onReadyEvent
=
&
event
;
return
false
;
case
STEP2
:
...
...
@@ -383,7 +383,7 @@ bool ChainPromiseNode::onReady(EventLoop::Event& event) noexcept {
}
void
ChainPromiseNode
::
get
(
ExceptionOrValue
&
output
)
noexcept
{
KJ_
I
REQUIRE
(
state
==
STEP2
);
KJ_REQUIRE
(
state
==
STEP2
);
return
inner
->
get
(
output
);
}
...
...
@@ -397,7 +397,7 @@ void ChainPromiseNode::fire() {
return
;
}
KJ_
I
REQUIRE
(
state
!=
STEP2
);
KJ_REQUIRE
(
state
!=
STEP2
);
static_assert
(
sizeof
(
Promise
<
int
>
)
==
sizeof
(
PromiseBase
),
"This code assumes Promise<T> does not add any new members to PromiseBase."
);
...
...
@@ -423,7 +423,7 @@ void ChainPromiseNode::fire() {
}
else
{
// We can only get here if inner->get() returned neither an exception nor a
// value, which never actually happens.
KJ_
IASSERT
(
false
,
"Inner node returned empty value."
);
KJ_
FAIL_ASSERT
(
"Inner node returned empty value."
);
}
state
=
STEP2
;
...
...
@@ -437,7 +437,7 @@ void ChainPromiseNode::fire() {
CrossThreadPromiseNodeBase
::
CrossThreadPromiseNodeBase
(
const
EventLoop
&
loop
,
Own
<
PromiseNode
>&&
dependent
,
ExceptionOrValue
&
resultRef
)
:
Event
(
loop
),
dependent
(
kj
::
mv
(
dependent
)),
resultRef
(
resultRef
)
{
KJ_
I
REQUIRE
(
this
->
dependent
->
isSafeEventLoop
(
loop
));
KJ_
D
REQUIRE
(
this
->
dependent
->
isSafeEventLoop
(
loop
));
// The constructor may be called from any thread, so before we can even call onReady() we need
// to switch threads.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment