Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
76a0795b
Commit
76a0795b
authored
8 years ago
by
Sree Kuchibhotla
Browse files
Options
Downloads
Patches
Plain Diff
Fix build errors on some configurations
parent
a2dd8385
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/core/lib/iomgr/ev_epoll_linux.c
+7
-6
7 additions, 6 deletions
src/core/lib/iomgr/ev_epoll_linux.c
test/core/iomgr/ev_epoll_linux_test.c
+8
-2
8 additions, 2 deletions
test/core/iomgr/ev_epoll_linux_test.c
with
15 additions
and
8 deletions
src/core/lib/iomgr/ev_epoll_linux.c
+
7
−
6
View file @
76a0795b
...
...
@@ -34,6 +34,7 @@
#include
<grpc/grpc_posix.h>
#include
<grpc/support/port_platform.h>
/* This polling engine is only relevant on linux kernels supporting epoll() */
#ifdef GPR_LINUX_EPOLL
#include
"src/core/lib/iomgr/ev_epoll_linux.h"
...
...
@@ -322,7 +323,7 @@ static void polling_island_add_fds_locked(polling_island *pi, grpc_fd **fds,
#ifdef GRPC_TSAN
/* See the definition of g_epoll_sync for more context */
gpr_atm_rel_store
(
&
g_epoll_sync
,
0
);
gpr_atm_rel_store
(
&
g_epoll_sync
,
(
gpr_atm
)
0
);
#endif
/* defined(GRPC_TSAN) */
for
(
i
=
0
;
i
<
fd_count
;
i
++
)
{
...
...
@@ -442,8 +443,8 @@ static polling_island *polling_island_create(grpc_fd *initial_fd) {
pi
->
fds
=
NULL
;
}
gpr_atm_rel_store
(
&
pi
->
ref_count
,
0
);
gpr_atm_rel_store
(
&
pi
->
merged_to
,
NULL
);
gpr_atm_rel_store
(
&
pi
->
ref_count
,
(
gpr_atm
)
0
);
gpr_atm_rel_store
(
&
pi
->
merged_to
,
(
gpr_atm
)
NULL
);
pi
->
epoll_fd
=
epoll_create1
(
EPOLL_CLOEXEC
);
...
...
@@ -472,7 +473,7 @@ static polling_island *polling_island_create(grpc_fd *initial_fd) {
static
void
polling_island_delete
(
polling_island
*
pi
)
{
GPR_ASSERT
(
pi
->
fd_cnt
==
0
);
gpr_atm_rel_store
(
&
pi
->
merged_to
,
NULL
);
gpr_atm_rel_store
(
&
pi
->
merged_to
,
(
gpr_atm
)
NULL
);
close
(
pi
->
epoll_fd
);
pi
->
epoll_fd
=
-
1
;
...
...
@@ -648,7 +649,7 @@ static polling_island *polling_island_merge(polling_island *p,
polling_island_add_wakeup_fd_locked
(
p
,
&
polling_island_wakeup_fd
);
/* Add the 'merged_to' link from p --> q */
gpr_atm_rel_store
(
&
p
->
merged_to
,
q
);
gpr_atm_rel_store
(
&
p
->
merged_to
,
(
gpr_atm
)
q
);
PI_ADD_REF
(
q
,
"pi_merge"
);
/* To account for the new incoming ref from p */
gpr_mu_unlock
(
&
p
->
mu
);
...
...
@@ -810,7 +811,7 @@ static grpc_fd *fd_create(int fd, const char *name) {
holding a lock to it anyway. */
gpr_mu_lock
(
&
new_fd
->
mu
);
gpr_atm_rel_store
(
&
new_fd
->
refst
,
1
);
gpr_atm_rel_store
(
&
new_fd
->
refst
,
(
gpr_atm
)
1
);
new_fd
->
fd
=
fd
;
new_fd
->
shutdown
=
false
;
new_fd
->
orphaned
=
false
;
...
...
This diff is collapsed.
Click to expand it.
test/core/iomgr/ev_epoll_linux_test.c
+
8
−
2
View file @
76a0795b
...
...
@@ -30,7 +30,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include
<grpc/support/port_platform.h>
/* This test only relevant on linux systems where epoll() is available */
#ifdef GPR_LINUX_EPOLL
#include
"src/core/lib/iomgr/ev_epoll_linux.h"
#include
"src/core/lib/iomgr/ev_posix.h"
...
...
@@ -128,8 +131,10 @@ static void test_add_fd_to_pollset() {
int
i
;
int
r
;
/* Create some dummy file descriptors (using pipe fds for this test. Could be
anything). Also NUM_FDS should be even for this test. */
/* Create some dummy file descriptors. Currently using pipe file descriptors
* for this test but we could use any other type of file descriptors. Also,
* since pipe() used in this test creates two fds in each call, NUM_FDS should
* be an even number */
for
(
i
=
0
;
i
<
NUM_FDS
;
i
=
i
+
2
)
{
r
=
pipe
(
fds
+
i
);
if
(
r
!=
0
)
{
...
...
@@ -234,3 +239,4 @@ int main(int argc, char **argv) {
grpc_iomgr_shutdown
();
return
0
;
}
#endif
/* defined(GPR_LINUX_EPOLL) */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment