Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

Commit

Permalink
Use an unsigned pointer compare, as the highest bit may sometimes be …
Browse files Browse the repository at this point in the history
…set.

This fixes intermittent connection issues on 32-bit Linux. Also related
to issues grpc#2557 and grpc#2600.
  • Loading branch information
cblichmann committed Aug 4, 2015
1 parent 32c4e5e commit e60c5e3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/iomgr/fd_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,15 @@ gpr_uint32 grpc_fd_begin_poll(grpc_fd *fd, grpc_pollset *pollset,
return 0;
}
/* if there is nobody polling for read, but we need to, then start doing so */
if (read_mask && !fd->read_watcher && gpr_atm_acq_load(&fd->readst) > READY) {
if (read_mask && !fd->read_watcher &&
gpr_atm_acq_load((gpr_uintptr *)&fd->readst) > READY) {
fd->read_watcher = watcher;
mask |= read_mask;
}
/* if there is nobody polling for write, but we need to, then start doing so
*/
if (write_mask && !fd->write_watcher && gpr_atm_acq_load(&fd->writest) > READY) {
if (write_mask && !fd->write_watcher &&
gpr_atm_acq_load((gpr_uintptr *)&fd->writest) > READY) {
fd->write_watcher = watcher;
mask |= write_mask;
}
Expand Down

0 comments on commit e60c5e3

Please sign in to comment.