OLD | NEW |
1 // Copyright 2006-2011 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 } | 467 } |
468 | 468 |
469 | 469 |
470 void Thread::YieldCPU() { | 470 void Thread::YieldCPU() { |
471 sched_yield(); | 471 sched_yield(); |
472 } | 472 } |
473 | 473 |
474 | 474 |
475 class CygwinMutex : public Mutex { | 475 class CygwinMutex : public Mutex { |
476 public: | 476 public: |
477 | |
478 CygwinMutex() { | 477 CygwinMutex() { |
479 pthread_mutexattr_t attrs; | 478 pthread_mutexattr_t attrs; |
480 memset(&attrs, 0, sizeof(attrs)); | 479 memset(&attrs, 0, sizeof(attrs)); |
481 | 480 |
482 int result = pthread_mutexattr_init(&attrs); | 481 int result = pthread_mutexattr_init(&attrs); |
483 ASSERT(result == 0); | 482 ASSERT(result == 0); |
484 result = pthread_mutexattr_settype(&attrs, PTHREAD_MUTEX_RECURSIVE); | 483 result = pthread_mutexattr_settype(&attrs, PTHREAD_MUTEX_RECURSIVE); |
485 ASSERT(result == 0); | 484 ASSERT(result == 0); |
486 result = pthread_mutex_init(&mutex_, &attrs); | 485 result = pthread_mutex_init(&mutex_, &attrs); |
487 ASSERT(result == 0); | 486 ASSERT(result == 0); |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 | 754 |
756 | 755 |
757 void Sampler::Stop() { | 756 void Sampler::Stop() { |
758 ASSERT(IsActive()); | 757 ASSERT(IsActive()); |
759 SamplerThread::RemoveActiveSampler(this); | 758 SamplerThread::RemoveActiveSampler(this); |
760 SetActive(false); | 759 SetActive(false); |
761 } | 760 } |
762 | 761 |
763 | 762 |
764 } } // namespace v8::internal | 763 } } // namespace v8::internal |
OLD | NEW |