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
bcafdb77
Commit
bcafdb77
authored
Nov 03, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GCC fixes.
parent
a0e2a45f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
Makefile.am
c++/Makefile.am
+3
-0
async-unix.c++
c++/src/kj/async-unix.c++
+9
-5
async-unix.h
c++/src/kj/async-unix.h
+1
-1
No files found.
c++/Makefile.am
View file @
bcafdb77
...
@@ -133,6 +133,7 @@ includekj_HEADERS = \
...
@@ -133,6 +133,7 @@ includekj_HEADERS = \
src/kj/mutex.h
\
src/kj/mutex.h
\
src/kj/thread.h
\
src/kj/thread.h
\
src/kj/async.h
\
src/kj/async.h
\
src/kj/async-unix.h
\
src/kj/main.h
src/kj/main.h
includekjparse_HEADERS
=
\
includekjparse_HEADERS
=
\
...
@@ -183,6 +184,7 @@ libkj_la_SOURCES= \
...
@@ -183,6 +184,7 @@ libkj_la_SOURCES= \
src/kj/mutex.c++
\
src/kj/mutex.c++
\
src/kj/thread.c++
\
src/kj/thread.c++
\
src/kj/async.c++
\
src/kj/async.c++
\
src/kj/async-unix.c++
\
src/kj/main.c++
\
src/kj/main.c++
\
src/kj/parse/char.c++
src/kj/parse/char.c++
...
@@ -323,6 +325,7 @@ capnp_test_SOURCES = \
...
@@ -323,6 +325,7 @@ capnp_test_SOURCES = \
src/kj/function-test.c++
\
src/kj/function-test.c++
\
src/kj/mutex-test.c++
\
src/kj/mutex-test.c++
\
src/kj/async-test.c++
\
src/kj/async-test.c++
\
src/kj/async-unix-test.c++
\
src/kj/parse/common-test.c++
\
src/kj/parse/common-test.c++
\
src/kj/parse/char-test.c++
\
src/kj/parse/char-test.c++
\
src/capnp/common-test.c++
\
src/capnp/common-test.c++
\
...
...
c++/src/kj/async-unix.c++
View file @
bcafdb77
...
@@ -61,20 +61,24 @@ public:
...
@@ -61,20 +61,24 @@ public:
}
}
}
}
template
<
typename
...
Params
>
template
<
typename
Param
>
void
fire
(
Param
s
&&
...
params
)
const
{
void
fire
(
Param
&&
param
)
const
{
// If the listener has not yet dropped its pointer to the Item, invokes the item's `fire()`
// If the listener has not yet dropped its pointer to the Item, invokes the item's `fire()`
// method with the given parameters.
// method with the given parameters.
//
// TODO(someday): This ought to be a variadic template, letting you pass any number of
// params. However, GCC 4.7 and 4.8 appear to get confused by param packs used inside
// lambdas. Clang handles it fine.
doOnce
([
&
]()
{
doOnce
([
&
]()
{
const_cast
<
Item
&>
(
item
).
fire
(
kj
::
fwd
<
Param
s
>
(
params
)...
);
const_cast
<
Item
&>
(
item
).
fire
(
kj
::
fwd
<
Param
>
(
param
)
);
});
});
}
}
private
:
private
:
Item
item
;
Item
item
;
mutable
_
::
Once
once
;
mutable
_
::
Once
once
;
uint
refcount
=
2
;
mutable
uint
refcount
=
2
;
ItemWrapper
*
next
=
nullptr
;
ItemWrapper
*
next
=
nullptr
;
// The ItemWrapper cannot be destroyed until this pointer becomes non-null.
// The ItemWrapper cannot be destroyed until this pointer becomes non-null.
...
@@ -248,7 +252,7 @@ private:
...
@@ -248,7 +252,7 @@ private:
// updating this pointer, so there's a chance it will remain behind indefinitely (if two threads
// updating this pointer, so there's a chance it will remain behind indefinitely (if two threads
// adding items at the same time race to update `tail`), but it should not be too far behind.
// adding items at the same time race to update `tail`), but it should not be too far behind.
NewWorkCallback
*
newWorkCallback
=
nullptr
;
mutable
NewWorkCallback
*
newWorkCallback
=
nullptr
;
};
};
// =======================================================================================
// =======================================================================================
...
...
c++/src/kj/async-unix.h
View file @
bcafdb77
...
@@ -92,7 +92,7 @@ private:
...
@@ -92,7 +92,7 @@ private:
Own
<
Impl
>
impl
;
Own
<
Impl
>
impl
;
pthread_t
waitThread
;
pthread_t
waitThread
;
bool
isSleeping
=
false
;
mutable
bool
isSleeping
=
false
;
};
};
}
// namespace kj
}
// namespace kj
...
...
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