
230 Cal.App.2d 390 (1964)
AMERICAN GUARANTY CORPORATION OF CALIFORNIA, Plaintiff and Respondent,
v.
WINSTON H. STOODY, Defendant and Appellant.
Civ. No. 27482. 
California Court of Appeals. Second Dist., Div. Four.  
Oct. 27, 1964.
 Oscar A. Trippet, Thomas H. Carver and Trippet, Yoakum & Ballantyne for Defendant and Appellant.
 Robert B. Krueger, Alvin S. Kaufer and Nossaman, Thompson, Waters & Moss for Plaintiff and Respondent.
 JEFFERSON, J.
 Plaintiff brought an action for breach of a guaranty contract allegedly executed by defendant Stoody (and by other parties not involved in this appeal). Plaintiff's complaint alleged that the contract in question guaranteed the faithful performance of rental payment obligations incurred by the lessee to the lessor under a number of equipment lease contracts. The complaint further alleged that the plaintiff is the assignee of the lessor under both the lease and the guaranty contracts.  [fn. 1]
 After filing its complaint plaintiff secured the issuance of a writ of attachment, in the approximate amount of $10,000, upon the filing of the required affidavit and undertaking. The writ was subsequently served upon a bank in which defendant Stoody maintained a safe-deposit box, and upon a corporation in which defendant held a number of shares. Defendant's motion to dissolve the attachment was denied. Defendant appeals from the order denying the motion, an appealable order. (Code Civ. Proc.,  963, subd. 2; Lohr v. Superior Court, 111 Cal.App.2d 231 [244 P.2d 5].)
 Defendant contends that the attachment should not have been issued because plaintiff was a secured creditor within the meaning of section 537, subdivision 1, of the Code of Civil *392 Procedure. Such contention is not based on any allegation that defendant himself gave any security to secure the guaranty agreement upon which this action is based, but upon the claim that, pursuant to certain Civil Code sections, defendant may take advantage of the security given to secure the principal obligation (under the equipment lease contracts).
 Plaintiff maintains that the motion to dissolve the attachment was properly denied, because the obligations of defendant under the guaranty contract were entirely independent of the rental obligations of the parties under the lease contracts which it, in effect, secured; that, in any event, defendant expressly waived the rights he now asserts as grounds for discharging the attachment; and that, even assuming defendant can take advantage of the security given on the primary obligation, he has not shown that the security allegedly held by plaintiff is the type of security which will bar an attachment.
 Section 537, subdivision 1, of the Code of Civil Procedure, provides: "The plaintiff ... may have the property of the defendant attached ...:"
 "1. In an action upon a contract, express or implied, for the direct payment of money, where the contract ... is not secured by any mortgage, deed of trust or lien upon real or personal property, or any pledge of personal property ..."
 The alleged obligation sued on by the plaintiff in the instant case, is a contract of continuing guaranty, which guarantees the payment of rents to be made by the lessee under the equipment lease contracts. (See Berg Metals Corp. v. Wilson, 170 Cal.App.2d 559, 569 [339 P.2d 869].) [1] In 1939, by an amendment to section 2787 of the Civil Code, the Legislature abolished the distinction which, up to that time, had existed between guarantors and sureties. (Bloom v. Bender, 48 Cal.2d 793, 797 [313 P.2d 568].) A continuing guaranty is now a form of suretyship obligation and is subject to all provisions of law relating to suretyship. (Hill & Morton, Inc. v. Coughlan, 214 Cal.App.2d 545, 548 [29 Cal.Rptr. 550]; Civ. Code,  2787.)
 Defendant asserts that, since the guarantee contract is subject to the laws relating to suretyship, it necessarily was subject to sections 2845 and 2849 of the Civil Code; that the latter code section gives him the benefit of the security given by the lessees under the equipment lease contracts.
 Civil Code section 2845 provides: "A surety may require his creditor to proceed against the principal, or to pursue any other remedy in his power which the surety can not himself *393 pursue, and which would lighten his burden; and if in such case the creditor neglects to do so, the surety is exonerated to the extent to which he is thereby prejudiced."
 Civil Code section 2849 provides that, "A surety is entitled to the benefit of every security for the performance of the principal obligation held by the creditor ... at the time of entering into the contract of suretyship, or acquired by him afterwards. ..."
 In two cases in California which have passed on the question of the validity of an attachment against a guarantor when the principal obligation is secured, Kelley v. Goldschmidt (1920) 47 Cal.App. 38 [190 P. 55], and Aronson & Co. v. Pearson (1926) 199 Cal. 286 [249 P. 188, 51 A.L.R. 1380], the attachments were held to be valid. Plaintiff cites these cases as being controlling. However, as pointed out by defendant, these cases represent an application of the statutory law as it existed prior to the 1939 amendment to Civil Code section 2787.
 Before such amendment, the courts of this state drew a distinction between a surety and a guarantor as the terms were defined in the statutes at that time. In a law review article written prior to the 1939 amendment legislation was proposed to abolish the distinction between a surety and a guarantor. The authors stated: "A distinction so formidable upon first impression, so difficult of application and so empty in effective content, should not be retained in the law." (10 So.Cal.L.Rev. 371, 405.) The article further stated, that under the law as it then existed, "[A]ttachment can not be had [under Code Civ. Proc.,  537, subd. 1] if the obligation is secured by mortgage, deed of trust, lien or pledge. If such security is taken from the principal alone, or from another secondary party, attachment remains possible against guarantors, but not against sureties. (10 So.Cal.L.Rev. 371, 401.)"
 The effect of the 1939 amendment to section 2787 upon guaranty contracts entered into after its effective date is clearly established. Thus, in Everts v. Matteson, 21 Cal.2d 437, 444 [132 P.2d 476], the court stated that the rule that the obligation of the principal debtor and that of the guarantor were entirely independent obligations was only applicable "... to contracts of guaranty made prior to the abolishment of the distinction between sureties and guarantors (Stats. 1939, ch. 453,  10)." (See also Ingalls v. Bell, 43 Cal.App.2d 356, 365 [110 P.2d 1068]; and Moffett v. Miller, 119 Cal.App.2d 712, 713 [260 P.2d 215].) *394
 In three cases (Bank of America v. Pauley, 119 Cal.App.2d 355, 364 [259 P.2d 714]; Palm Springs S. & S. Inc. v. Bering, 213 Cal.App.2d 177, 181 [28 Cal.Rptr. 526]; and Eisendrath v. Bank of America, 118 Cal.App.2d 434, 438 [258 P.2d 13]) which were decided subsequent to the 1939 legislation it appears that the effect of the amendments was not considered and the decisions followed the case law based on the statutes as they existed prior to the 1939 amendments. We deem them inapplicable to the instant case where the effect of the amendments is made an issue.
 Plaintiff maintains that defendant expressly waived any rights he might otherwise have asserted under Civil Code sections 2845 and 2849.
 [2a] The contract upon which plaintiff's action is based reads in part:
 "(5) Guarantors waive any right to require Lessor to (a) proceed against Lessees; (b) proceed against or exhaust any security held from Lessees; or (c) pursue any other remedy in Lessor's power whatsoever. Guarantors waive any defense arising by reason of the cessation from any cause whatsoever of the liability of Lessees. Until all obligations of Lessees to Lessor shall have been paid in full Guarantors shall have no right of subrogation, and waive any right to enforce any remedy which Lessor now has or may hereafter have against Lessees and waive any benefit of, and any right to participate in any security now or hereafter held by Lessor." (Italics added.)
 That a person may waive the advantages of a law which is intended for his benefit is a clearly established rule of law. Section 3513 of the Civil Code, provides: "Anyone may waive the advantage of a law intended solely for his benefit. But a law established for a public reason cannot be contravened by a private agreement."
 In Bloom v. Bender, supra, the plaintiff creditor released the primary obligor pursuant to a composition of creditors and the defendant guarantor contended that, by application of the laws relating to suretyship (and in particular, sections 2819 and 2809 of the Civil Code), she was also released. The court held, however, that defendant had given advance consent to the release in the guaranty contract, which contained a provision that the liability of the guarantor, "shall not be affected by ... the acceptance of any settlement or composition offered by ... [the primary obligor]." In so holding, the court stated that it is a general principle of *395 suretyship law that "... the contract is to be interpreted by the same rules used in construing other types of contracts, with a view towards effectuating the purposes for which the contract was designed." (Bloom v. Bender, supra, at p. 803; see also Bank of America v. Waters, 209 Cal.App.2d 635, 638 [26 Cal.Rptr. 9].) After stating that the waiver provision in the contract was not violative of public policy, the Supreme Court, in the Bloom case, supra, further stated (at p. 803) that "... carrying out the expressed intent of the parties accords with the basic rules of suretyship law as above stated and as particularly embodied in sections 2837 and 3268 of the Civil Code."
 "That the above stated view follows the policy of the law is forcefully indicated by the provisions of section 3268 of the Civil Code. That section provides that 'Except where it is otherwise declared, the provisions of the foregoing fifteen titles of this part [which includes the Title on Suretyship,  2787-2866], in respect to the rights and obligations of parties to contracts, are subordinate to the intention of the parties, when ascertained in the manner prescribed by the chapter on the interpretation of contracts; and the benefit thereof may be waived by any party entitled thereto, unless such waiver would be against public policy.' " (Bloom v. Bender, supra, at p. 803.) See also Berg Metals Corp. v. Wilson, 170 Cal.App.2d 559 [339 P.2d 869], wherein the court used the same reasoning to hold that the defendant guarantors waived the right to complain of delay on the part of the plaintiff creditor in enforcing a guaranty of collection.
 [3a] Defendant argues that the waiver provision is invalid as against public policy. He points to a statement by the court in Lencioni v. Dan, 128 Cal.App.2d 105 [275 P.2d 101]. In a footnote (at p. 111) the court said: "It is true that a seller retaining title may waive his security and sue at either law or equity. [Citation.] But we have been referred to no case and have found none holding that such a seller may thus become an unsecured creditor and secure an attachment to replace his waived security under section 537, subdivision 1, of the Code of Civil Procedure. The policy of the law is that a creditor holding security shall not resort to attachment until he has exhausted such security. (See discussion 5 Cal.Jur.2d,  26, p. 628.) Such policy, it could be argued, would be violated if a secured creditor were permitted at will to waive his security and then seek further security by way of attachment." *396
 The instant case however does not present such a situation. [2b] Here the guarantor waives his right under section 2849 to the benefit of the security given by the principal obligor. [3b] We can see no policy reason why a guarantor should not be permitted, by contract, to waive his entitlement to this benefit.
 Having found defendant has waived his rights under sections 2849 and 2845, we need not examine the nature of the security given by the principal obligor to determine if it was the type denominated in section 537, subdivision 1.
 The order denying the motion to discharge the attachment is affirmed.
 Burke, P. J., and Kingsley, J., concurred.
NOTES
[fn. 1]  1. Neither the lessee nor the lessor of the lease contracts are parties to the present action.
