| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 TEST_F(PosixSignalDeliveryTest, SignalOnDifferentThread) { | 603 TEST_F(PosixSignalDeliveryTest, SignalOnDifferentThread) { |
| 604 ss_->SetPosixSignalHandler(SIGTERM, &RecordSignal); | 604 ss_->SetPosixSignalHandler(SIGTERM, &RecordSignal); |
| 605 // Mask out SIGTERM so that it can't be delivered to this thread. | 605 // Mask out SIGTERM so that it can't be delivered to this thread. |
| 606 sigset_t mask; | 606 sigset_t mask; |
| 607 sigemptyset(&mask); | 607 sigemptyset(&mask); |
| 608 sigaddset(&mask, SIGTERM); | 608 sigaddset(&mask, SIGTERM); |
| 609 EXPECT_EQ(0, pthread_sigmask(SIG_SETMASK, &mask, nullptr)); | 609 EXPECT_EQ(0, pthread_sigmask(SIG_SETMASK, &mask, nullptr)); |
| 610 // Start a new thread that raises it. It will have to be delivered to that | 610 // Start a new thread that raises it. It will have to be delivered to that |
| 611 // thread. Our implementation should safely handle it and dispatch | 611 // thread. Our implementation should safely handle it and dispatch |
| 612 // RecordSignal() on this thread. | 612 // RecordSignal() on this thread. |
| 613 std::unique_ptr<Thread> thread(new Thread()); | 613 std::unique_ptr<Thread> thread(Thread::CreateWithSocketServer()); |
| 614 std::unique_ptr<RaiseSigTermRunnable> runnable(new RaiseSigTermRunnable()); | 614 std::unique_ptr<RaiseSigTermRunnable> runnable(new RaiseSigTermRunnable()); |
| 615 thread->Start(runnable.get()); | 615 thread->Start(runnable.get()); |
| 616 EXPECT_TRUE(ss_->Wait(1500, true)); | 616 EXPECT_TRUE(ss_->Wait(1500, true)); |
| 617 EXPECT_TRUE(ExpectSignal(SIGTERM)); | 617 EXPECT_TRUE(ExpectSignal(SIGTERM)); |
| 618 EXPECT_EQ(Thread::Current(), signaled_thread_); | 618 EXPECT_EQ(Thread::Current(), signaled_thread_); |
| 619 EXPECT_TRUE(ExpectNone()); | 619 EXPECT_TRUE(ExpectNone()); |
| 620 } | 620 } |
| 621 | 621 |
| 622 #endif | 622 #endif |
| 623 | 623 |
| 624 } // namespace rtc | 624 } // namespace rtc |
| OLD | NEW |